/**
 * Reusable file-status icon for any file row that participates in a
 * pipeline (classification, validation, etc.). Surfaces the current
 * processing state at a glance without dominating the row.
 *
 * States:
 *   - queued       → grey clock badge over the file glyph (waiting)
 *   - classifying  → blue spinner
 *   - validating   → blue spinner
 *   - done / null  → plain file glyph
 *   - error        → red triangle
 *
 * Consumers pass the status string; the icon picks the right glyph.
 */
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from '../../utils/cn.js';
// Color tokens — keep glyph color obvious even on coloured backgrounds.
const NORMAL_COLOR = '#2563EB'; // blue-600 — default/done state
const QUEUED_COLOR = '#94A3B8'; // slate-400 — clearly faded vs the active blue
const ERROR_COLOR = '#DC2626'; // red-600 — error state
export function FileStatusIcon({ status, is_replaced, className }) {
    if (status === 'queued') {
        return (_jsxs("span", { className: cn('relative inline-flex w-4 h-4 flex-shrink-0', className), title: "Queued \u2014 waiting for processing", children: [_jsx(PdfGlyph, { color: QUEUED_COLOR, dashed: true, className: "w-4 h-4" }), _jsxs("svg", { className: "absolute -right-1 -bottom-1 w-2.5 h-2.5", viewBox: "0 0 16 16", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "7", fill: "#F59E0B", stroke: "white", strokeWidth: "1.5" }), _jsx("path", { d: "M8 4.5v3.8l2.4 1.4", stroke: "white", strokeWidth: "1.6", strokeLinecap: "round", fill: "none" })] })] }));
    }
    if (status === 'classifying' || status === 'validating') {
        return (_jsxs("svg", { className: cn('w-4 h-4 text-blue-500 animate-spin flex-shrink-0', className), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "aria-label": status === 'classifying' ? 'Classifying' : 'Validating', children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }));
    }
    if (status === 'error') {
        return (_jsxs("span", { className: cn('relative inline-flex w-4 h-4 flex-shrink-0', className), title: "Pipeline error", children: [_jsx(PdfGlyph, { color: ERROR_COLOR, className: "w-4 h-4" }), _jsxs("svg", { className: "absolute -right-1 -bottom-1 w-2.5 h-2.5", viewBox: "0 0 16 16", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "7", fill: "#DC2626", stroke: "white", strokeWidth: "1.5" }), _jsx("path", { d: "M8 4v5M8 11.2v.6", stroke: "white", strokeWidth: "1.6", strokeLinecap: "round" })] })] }));
    }
    // Default / done state — solid blue PDF.
    return (_jsx(PdfGlyph, { color: NORMAL_COLOR, className: cn('w-4 h-4', is_replaced && 'opacity-40', className) }));
}
function PdfGlyph({ className, color, dashed, }) {
    return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", "aria-hidden": "true", children: [_jsx("path", { d: "M3 1.5A1.5 1.5 0 0 1 4.5 0h5.379a1.5 1.5 0 0 1 1.06.44l3.122 3.12a1.5 1.5 0 0 1 .439 1.061V14.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 3 14.5v-13zM4.5 1a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V5h-3.5A1.5 1.5 0 0 1 9 3.5V1H4.5z", fill: color, stroke: dashed ? color : undefined, strokeWidth: dashed ? 0.5 : undefined, strokeDasharray: dashed ? '1.4 1' : undefined, opacity: dashed ? 0.85 : 1 }), _jsx("text", { x: "8", y: "12", textAnchor: "middle", fontSize: "4.5", fontWeight: "700", fill: "white", children: "PDF" })] }));
}
//# sourceMappingURL=file_status_icon.js.map