import { Container, Markdown } from "@earendil-works/pi-tui";
export class UserMessageComponent extends Container {
    theme;
    constructor(theme, model) {
        super();
        this.theme = theme;
        this.update(model);
    }
    update(model) {
        const bgColor = model.kind === "memory"
            ? this.theme.palette.userMemorySurface
            : model.kind === "review"
                ? this.theme.palette.userReviewSurface
                : this.theme.palette.userSurface;
        const color = model.kind === "memory"
            ? this.theme.palette.userMemoryText
            : model.kind === "review"
                ? this.theme.palette.userReviewText
                : this.theme.palette.textDefault;
        this.clear();
        this.addChild(new Markdown(model.text, 1, 1, this.theme.markdownTheme, {
            bgColor: (t) => bgColor(t),
            color: (t) => color(t),
        }));
    }
}
//# sourceMappingURL=user_message.js.map