import { CheckCircle2, Clock, Loader2 } from "lucide-react";
import type { ScanJobState } from "@/shared/types";
import { formatRelativeTime } from "../shared/lib/format";
export function StatusBadge({
state,
finishedAt,
}: {
state: ScanJobState | null | undefined;
finishedAt?: string | null;
}) {
if (state === "completed") {
return (
{finishedAt ? `Scanned ${formatRelativeTime(finishedAt)}` : "Completed"}
);
}
if (state === "scanning" || state === "dispatching") {
return (
Scanning
);
}
// queued / failed / null → Waiting(fish No.491:scanning 独立展示,failed 仍归 waiting)
return (
Waiting to be scanned
);
}
export function ScanningSpinner({ label = "Loading…" }: { label?: string }) {
return (
{label}
);
}