import PropTypes from 'prop-types' import { getHueForUserId } from '../../../shared/utils/colors' import MessageContent from './message-content' function Message({ message, userId }) { function hue(user) { return user ? getHueForUserId(user.id, userId) : 0 } function getMessageStyle(user) { return { borderColor: `hsl(${hue(user)}, 85%, 40%)`, backgroundColor: `hsl(${hue(user)}, 85%, 40%`, } } function getArrowStyle(user) { return { borderColor: `hsl(${hue(user)}, 85%, 40%)`, } } const isMessageFromSelf = message.user ? message.user.id === userId : false return (