import React, { memo } from 'react'; import classnames from 'classnames'; import Text from 'components/Text'; import stringToRGB from 'utils/color'; const Message = ({ message, coloredNick, onNickClick }) => { const className = classnames('message', { [`message-${message.type}`]: message.type }); if (message.type === 'date') { return (
{message.content}
); } const style = { paddingLeft: `${message.indent + 15}px`, textIndent: `-${message.indent}px` }; const senderStyle = {}; if (message.from && coloredNick) { senderStyle.color = stringToRGB(message.from); } return (

{message.time} {message.from && ( onNickClick(message.from)} > {message.from} )} {' '} {message.content}

); }; export default memo(Message);