import { Container, Text } from "@earendil-works/pi-tui";
export class SystemMessageComponent extends Container {
    theme;
    constructor(theme, model) {
        super();
        this.theme = theme;
        this.update(model);
    }
    update(model) {
        const { palette } = this.theme;
        const style = model.kind === "error"
            ? palette.toastError
            : model.kind === "warn"
                ? palette.toastWarn
                : model.kind === "muted"
                    ? palette.textMuted
                    : palette.toastSuccess;
        this.clear();
        this.addChild(new Text(style(model.text), 1, 0));
    }
}
//# sourceMappingURL=system_message.js.map