owncast/web/components/chat/ChatUserMessage/ChatUserMessage.tsx

28 lines
843 B
TypeScript
Raw Normal View History

2022-05-22 16:10:34 +02:00
import { ChatMessage } from '../../../interfaces/chat-message.model';
import s from './ChatUserMessage.module.scss';
interface Props {
message: ChatMessage;
showModeratorMenu: boolean;
}
export default function ChatUserMessage(props: Props) {
const { message, showModeratorMenu } = props;
2022-05-12 08:31:31 +02:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { body, user, timestamp } = message;
2022-05-12 08:31:31 +02:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { displayName, displayColor } = user;
2022-05-22 16:10:34 +02:00
const color = `hsl(${displayColor}, 100%, 70%)`;
return (
2022-05-22 16:10:34 +02:00
<div className={s.root} style={{ borderColor: color }}>
<div className={s.user} style={{ color }}>
{displayName}
</div>
<div className={s.message}>{body}</div>
{showModeratorMenu && <div>Moderator menu</div>}
</div>
);
}