"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentWarningBadge = ContentWarningBadge;
const jsx_runtime_1 = require("react/jsx-runtime");
const lucide_react_native_1 = require("lucide-react-native");
const react_native_1 = require("react-native");
const __1 = require("../..");
const metadata_constants_1 = require("../../lib/metadata-constants");
const theme_1 = require("../../lib/theme/theme");
const ui_1 = require("../../ui");
const dropdown_1 = require("../ui/dropdown");
const text_1 = require("../ui/text");
const { px, py, gap, layout } = __1.zero;
function ContentWarningBadge({ warnings }) {
    const { theme } = (0, theme_1.useTheme)();
    const getWarningLabel = (warning) => {
        return metadata_constants_1.C2PA_WARNING_LABELS[warning] || warning;
    };
    if (!warnings || warnings.length === 0) {
        return null;
    }
    return ((0, jsx_runtime_1.jsxs)(dropdown_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(dropdown_1.DropdownMenuTrigger, { children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
                        layout.flex.row,
                        layout.flex.align.center,
                        gap.all[2],
                        px[3],
                        py[2],
                        ui_1.r.md,
                        { backgroundColor: (0, ui_1.hexToRgba)(theme.colors.warning, 0.13) },
                    ], children: [(0, jsx_runtime_1.jsx)(lucide_react_native_1.AlertTriangle, { size: 14, color: theme.colors.warningForeground }), (0, jsx_runtime_1.jsx)(text_1.Text, { size: "sm", weight: "semibold", style: { color: theme.colors.warningForeground }, children: "Intended for certain audiences" }), (0, jsx_runtime_1.jsx)(lucide_react_native_1.ChevronDown, { size: 14, color: theme.colors.warningForeground })] }) }), (0, jsx_runtime_1.jsxs)(dropdown_1.ResponsiveDropdownMenuContent, { children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [layout.flex.column, px[2], ui_1.pt[2]], children: [(0, jsx_runtime_1.jsx)(text_1.Text, { children: "Heads up!" }), (0, jsx_runtime_1.jsx)(text_1.Text, { children: "This stream may contain:" })] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
                            layout.flex.row,
                            { flexWrap: "wrap" },
                            gap.all[2],
                            px[2],
                            py[2],
                        ], children: warnings.map((warning, index) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
                                { backgroundColor: theme.colors.warning },
                                px[3],
                                py[1],
                                ui_1.r.full,
                            ], children: (0, jsx_runtime_1.jsx)(text_1.Text, { size: "sm", weight: "semibold", style: { color: theme.colors.warningForeground }, children: getWarningLabel(warning) }) }, index))) })] })] }));
}
//# sourceMappingURL=content-warning-badge.js.map