import { Badge } from "@/components/ui/badge"; import type { PhaseStatus } from "@/lib/api"; import { cn } from "@/lib/utils"; const STATUS_LABEL: Record = { pending: "Pending", running: "Running", completed: "Done", failed: "Failed", }; // Failed (system error: timeout, crash, infra) renders grey/muted — distinct // from "destructive" red which is reserved for quality verdicts (Rejected). const STATUS_VARIANT: Record< PhaseStatus, "secondary" | "info" | "success" | "muted" > = { pending: "secondary", running: "info", completed: "success", failed: "muted", }; export function PhaseHeader({ index, title, status, description, className, }: { index?: number; title: string; status: PhaseStatus; description?: string; className?: string; }) { return (
{typeof index === "number" && ( {index.toString().padStart(2, "0")} )}

{title}

{description && (

{description}

)}
{STATUS_LABEL[status]}
); }