import { h } from 'preact'; import PropTypes from 'prop-types'; import { adjustTimestamp } from './util'; export const ActionMessage = ({ user, message, color, timestamp, profileImageUrl, onContentTrigger, }) => { const spanStyle = { color }; const messageArea = ( ); return (
{`${user}
{user} {`${adjustTimestamp(timestamp)}`}
{messageArea}
); }; ActionMessage.propTypes = { user: PropTypes.string.isRequired, color: PropTypes.string.isRequired, message: PropTypes.string.isRequired, timestamp: PropTypes.string, profileImageUrl: PropTypes.string, onContentTrigger: PropTypes.func.isRequired, }; ActionMessage.defaultProps = { profileImageUrl: '', timestamp: null, };