"use client"; import type { CaseStatus } from "@/lib/api/cases"; import { STATUS_LABELS, STATUS_ICONS, STATUS_DESCRIPTIONS } from "@/components/cases/status-badge"; import { FolderInput, ClipboardList, Brain, PenLine, CheckCircle2, } from "lucide-react"; import type { LucideIcon } from "lucide-react"; /* * Vertical RTL workflow timeline showing the 13-status case pipeline. * Groups the raw statuses into the 5 visual phases used across the app * (intake → prep → thinking → writing → done) so the user sees * "where am I in the process" rather than 13 micro-steps. */ type Phase = { key: string; label: string; icon: LucideIcon; statuses: CaseStatus[]; }; const PHASES: Phase[] = [ { key: "intake", label: "קליטה ועיבוד", icon: FolderInput, statuses: ["new", "uploading", "processing"] }, { key: "prep", label: "הכנת תיק", icon: ClipboardList, statuses: ["documents_ready", "analyst_verified", "research_complete", "outcome_set"] }, { key: "thinking", label: "ניתוח וכיוון", icon: Brain, statuses: ["brainstorming", "direction_approved", "analysis_enriched", "ready_for_writing"] }, { key: "writing", label: "כתיבת טיוטה", icon: PenLine, statuses: ["drafting", "qa_review", "drafted"] }, { key: "done", label: "סגירה", icon: CheckCircle2, statuses: ["exported", "reviewed", "final"] }, ]; function phaseIndexOf(status?: CaseStatus): number { if (!status) return -1; return PHASES.findIndex((p) => p.statuses.includes(status)); } export function WorkflowTimeline({ status }: { status?: CaseStatus }) { const currentIdx = phaseIndexOf(status); return (