"use client"; import { Check, Loader2 } from "lucide-react"; import type { DocumentDetail } from "@/lib/types"; /** * A slim live stepper that reflects pipeline progress by inspecting which * parts of the document detail have been populated. Renders only while the * document is still processing. */ export default function ProcessingBar({ detail }: { detail: DocumentDetail }) { if (detail.status === "ready" || detail.status === "failed") return null; const steps = [ { label: "Parsing", done: (detail.pages?.length ?? 0) > 0 }, { label: "Classifying", done: !!detail.classification }, { label: "Extracting", done: !!detail.extraction }, { label: "Summarizing", done: !!detail.summary }, ]; const activeIdx = steps.findIndex((s) => !s.done); return (