freshter-logs/components/RenderMsg.tsx
2023-04-28 19:48:34 -04:00

27 lines
630 B
TypeScript

import { msg_style } from "style";
import { Conversation, Database, Message } from "types";
export default function RenderMsg({
msg,
db,
conversation,
additional_style = {},
...props
}: {
msg: Message;
db: Database;
additional_style?: preact.JSX.CSSProperties;
conversation?: Conversation;
}) {
return (
<div
// className={class_list("message", `preset-${msg.preset}`)}
style={{ ...msg_style(msg, db, conversation), ...additional_style }}
className={msg.preset}
{...props}
>
{msg.content}
</div>
);
}