import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from "react";
import { AlertTriangle, ChevronDown } from "lucide-react";
import { cn } from "../../../lib/utils";
/**
 * Displays non-fatal warnings collected during embedding staging / real-time indexing
 * (e.g. text truncated to fit the model's max input tokens). Warnings are surfaced
 * here instead of in the Sitecore log.
 */
export function CollectionWarningsDisplay({ warnings, }) {
    const [showWarnings, setShowWarnings] = useState(false);
    if (!warnings || warnings.length === 0)
        return null;
    return (_jsxs("div", { className: "border-feedback-orange bg-feedback-orange-light rounded-lg border p-3", children: [_jsxs("button", { className: "flex w-full cursor-pointer items-center justify-between text-sm", onClick: () => setShowWarnings((v) => !v), children: [_jsxs("div", { className: "text-feedback-orange flex items-center gap-2 font-medium", children: [_jsx(AlertTriangle, { className: "h-4 w-4", strokeWidth: 1 }), warnings.length, " warning", warnings.length !== 1 ? "s" : "", " during embedding collection"] }), _jsx(ChevronDown, { className: cn("text-feedback-orange h-4 w-4 transition-transform duration-200", showWarnings ? "rotate-180" : ""), strokeWidth: 1 })] }), showWarnings && (_jsx("ul", { className: "border-feedback-orange mt-2 space-y-1 border-t pt-2", children: warnings.map((warning, idx) => (_jsx("li", { className: "text-feedback-orange truncate text-xs", title: warning, children: warning }, idx))) }))] }));
}
//# sourceMappingURL=CollectionWarningsDisplay.js.map