"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentWarnings = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
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 text_1 = require("../ui/text");
const { layout, gap, bg, r, p, px, py, text: textStyles, borders } = __1.zero;
exports.ContentWarnings = (0, react_1.forwardRef)(({ warnings, compact = false, ...rest }, ref) => {
    const { theme } = (0, theme_1.useTheme)();
    if (!warnings || warnings.length === 0) {
        return null;
    }
    const getWarningLabel = (warning) => {
        return metadata_constants_1.C2PA_WARNING_LABELS[warning] || warning;
    };
    if (compact) {
        return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [layout.flex.row, layout.flex.wrap.wrap, gap.all[1]], ...rest, children: warnings.map((warning, index) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
                    { backgroundColor: theme.colors.warning },
                    r.full,
                    px[2],
                    { paddingVertical: 2 },
                ], children: (0, jsx_runtime_1.jsx)(text_1.Text, { size: "sm", style: [{ color: theme.colors.warningForeground }], children: getWarningLabel(warning) }) }, index))) }));
    }
    return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { ref: ref, style: [layout.flex.column, gap.all[2]], ...rest, children: [(0, jsx_runtime_1.jsx)(text_1.Text, { style: [{ fontSize: 14, fontWeight: "600" }, textStyles.gray[900]], children: "Content Warnings" }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [layout.flex.row, layout.flex.wrap.wrap, gap.all[2]], children: warnings.map((warning, index) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
                        { backgroundColor: theme.colors.warning },
                        r.full,
                        px[3],
                        py[1],
                    ], children: (0, jsx_runtime_1.jsx)(text_1.Text, { size: "sm", style: [{ color: theme.colors.warningForeground }], children: getWarningLabel(warning) }) }, index))) })] }));
});
exports.ContentWarnings.displayName = "ContentWarnings";
//# sourceMappingURL=content-warnings.js.map