"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SystemMessage = SystemMessage;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_native_1 = require("react-native");
const system_messages_1 = require("../../lib/system-messages");
const ui_1 = require("../../ui");
const text_1 = require("../ui/text");
const chat_message_1 = require("./chat-message");
function SystemMessage({ variant, title, timestamp, facets, }) {
    const isError = variant === system_messages_1.SystemMessageType.command_error;
    return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
            ui_1.w.percent[100],
            react_native_1.Platform.OS === "web" && ui_1.px[2],
            ui_1.pb[2],
            isError && ui_1.bg.red[950],
            isError && ui_1.r.md,
        ], children: [(0, jsx_runtime_1.jsx)(text_1.Code, { color: "muted", tracking: "widest", style: [react_native_1.Platform.OS === "web" ? ui_1.pl[12] : ui_1.pl[11], ui_1.ml[1]], children: "SYSTEM MESSAGE" }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [ui_1.gap.all[2], ui_1.layout.flex.row], children: [(0, jsx_runtime_1.jsx)(text_1.Text, { style: {
                            fontVariant: ["tabular-nums"],
                            color: ui_1.colors.gray[400],
                        }, children: timestamp.toLocaleTimeString([], {
                            hour: "2-digit",
                            minute: "2-digit",
                            hour12: false,
                        }) }), (0, jsx_runtime_1.jsx)(text_1.Text, { weight: "bold", color: "default", style: [ui_1.flex.shrink[1]], children: (0, jsx_runtime_1.jsx)(chat_message_1.RichTextMessage, { facets: facets, text: title }) })] })] }));
}
exports.default = SystemMessage;
//# sourceMappingURL=system-message.js.map