"use client";
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { memo } from "react";
import { cn } from "@stigmer/theme";
import { formatDuration, formatTimestamp } from "../format-utils";
export const RetriesTab = memo(function RetriesTab({ retries, className }) {
    return (_jsxs("div", { className: cn("flex flex-col gap-2", className), children: [_jsxs("p", { className: "text-xs text-muted-foreground", children: [retries.attempts.length, " attempt", retries.attempts.length !== 1 ? "s" : "", retries.currentAttempt > 1 && _jsxs(_Fragment, { children: [" \u00B7 currently on attempt ", retries.currentAttempt] })] }), _jsx("div", { className: "flex flex-col gap-1", children: retries.attempts.map((attempt) => (_jsxs("div", { className: cn("flex flex-col gap-0.5 rounded-md border px-2.5 py-2 text-xs", attempt.status === "failed"
                        ? "border-destructive/20 bg-destructive/5"
                        : "border-border bg-muted/30"), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: cn("flex size-3.5 items-center justify-center rounded-full text-[8px]", attempt.status === "failed" ? "bg-destructive text-destructive-foreground" : "bg-success text-success-foreground"), children: attempt.status === "failed" ? "✕" : "✓" }), _jsxs("span", { className: "font-medium text-foreground", children: ["Attempt ", attempt.attemptNumber] }), attempt.durationMs > 0 && (_jsx("span", { className: "tabular-nums text-muted-foreground", children: formatDuration(attempt.durationMs) })), attempt.startedAt && (_jsx("span", { className: "ml-auto text-[10px] tabular-nums text-muted-foreground", children: formatTimestamp(attempt.startedAt) }))] }), attempt.error && (_jsx("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-[11px] text-destructive/80", children: attempt.error })), attempt.delayBeforeMs > 0 && (_jsxs("p", { className: "text-[10px] text-muted-foreground", children: ["Backoff: ", formatDuration(attempt.delayBeforeMs)] }))] }, attempt.attemptNumber))) })] }));
});
//# sourceMappingURL=RetriesTab.js.map