'use client';
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { TriangleAlert, X } from 'lucide-react';
/** Inline banner listing blocking errors (and non-blocking warnings). */
export function ValidationSummary({ errors, warnings, onDismiss }) {
    if (errors.length === 0 && warnings.length === 0)
        return null;
    return (_jsx("div", { role: "alert", className: "border-destructive/30 bg-destructive/5 mx-4 mt-3 rounded-lg border p-3", children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx(TriangleAlert, { className: "text-destructive mt-0.5 h-4 w-4 shrink-0", "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [errors.length > 0 && (_jsxs(_Fragment, { children: [_jsxs("p", { className: "text-foreground text-sm font-medium", children: ["Resolve ", errors.length, " issue", errors.length === 1 ? '' : 's', " before publishing"] }), _jsx("ul", { className: "text-muted-foreground mt-1 list-disc space-y-0.5 pl-4 text-xs", children: errors.map((e, i) => (_jsx("li", { children: e }, `e-${i}`))) })] })), warnings.length > 0 && (_jsx("ul", { className: "text-muted-foreground mt-2 list-disc space-y-0.5 pl-4 text-xs", children: warnings.map((w, i) => (_jsx("li", { children: w }, `w-${i}`))) }))] }), _jsx("button", { type: "button", onClick: onDismiss, "aria-label": "Dismiss", className: "text-muted-foreground hover:text-foreground rounded p-0.5", children: _jsx(X, { className: "h-4 w-4", "aria-hidden": true }) })] }) }));
}
//# sourceMappingURL=ValidationSummary.js.map