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>
    );
}
