import React from 'react' import PropTypes from 'prop-types' import ColorManager from '../../../ide/colors/ColorManager' import MessageContent from './message-content' function Message({ message, userId }) { const { chatMessageBorderSaturation, chatMessageBorderLightness, chatMessageBgSaturation, chatMessageBgLightness } = window.uiConfig function hue(user) { return user ? ColorManager.getHueForUserId(user.id) : 0 } function getMessageStyle(user) { return { borderColor: `hsl(${hue( user )}, ${chatMessageBorderSaturation}, ${chatMessageBorderLightness})`, backgroundColor: `hsl(${hue( user )}, ${chatMessageBgSaturation}, ${chatMessageBgLightness})` } } function getArrowStyle(user) { return { borderColor: `hsl(${hue( user )}, ${chatMessageBorderSaturation}, ${chatMessageBorderLightness})` } } const isMessageFromSelf = message.user ? message.user.id === userId : false return (