import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { RefreshCw, AlertTriangle, ChevronDown } from "lucide-react";
import { cn } from "../../../lib/utils";
/**
 * Displays queue errors with retry functionality
 */
export function QueueErrorsDisplay({ queueStatus, showQueueErrors, onToggleErrors, onRetryFailed, isRetryingFailed, retryFailedMessage, }) {
    return (_jsxs("div", { className: "border-feedback-red bg-feedback-red-light rounded-lg border p-3", children: [_jsxs("button", { className: "flex w-full cursor-pointer items-center justify-between text-sm", onClick: onToggleErrors, children: [_jsxs("div", { className: "text-feedback-red flex items-center gap-2 font-medium", children: [_jsx(AlertTriangle, { className: "h-4 w-4", strokeWidth: 1 }), queueStatus.errorCount, " error", queueStatus.errorCount !== 1 ? "s" : "", " during embedding generation"] }), _jsx(ChevronDown, { className: cn("text-feedback-red h-4 w-4 transition-transform duration-200", showQueueErrors ? "rotate-180" : ""), strokeWidth: 1 })] }), _jsxs("div", { className: "border-feedback-red mt-2 flex flex-wrap items-center gap-2 border-t pt-2", children: [_jsxs("button", { onClick: onRetryFailed, disabled: isRetryingFailed, className: "bg-feedback-red hover:bg-feedback-red flex items-center gap-2 rounded px-3 py-1.5 text-sm font-medium text-white", children: [_jsx(RefreshCw, { className: cn("h-4 w-4", isRetryingFailed ? "animate-spin" : ""), strokeWidth: 1 }), _jsxs("div", { className: "flex flex-col items-start", children: [isRetryingFailed ? "Retrying..." : "Retry", " ", _jsx("div", { className: "text-xs text-white", children: "Re-queues failed items so they can be processed again." })] })] }), retryFailedMessage && (_jsx("div", { className: "text-feedback-red text-xs", children: retryFailedMessage }))] }), showQueueErrors && (_jsx("ul", { className: "mt-2 space-y-1", children: queueStatus.recentErrors.map((error, idx) => (_jsx("li", { className: "text-feedback-red truncate text-xs", title: error, children: error }, idx))) }))] }));
}
//# sourceMappingURL=QueueErrorsDisplay.js.map