import type { ProjectDetail, ProjectStageDTO } from "@dci/core"; import { ExternalLink } from "lucide-react"; import { StatusDot } from "@/components/ui/status-dot"; import { cn } from "@/components/ui/cn"; import { fmtInt } from "@/lib/format"; import { fmtPartialDateSafe } from "@/lib/format-project"; import { STAGE_LABEL } from "@/lib/labels"; const MAIN: ProjectStageDTO["stage"][] = ["rumored", "proposed", "announced", "permitting", "approved", "under_construction", "partially_operational", "operational"]; const SIDE: ProjectStageDTO["stage"][] = ["delayed", "cancelled"]; /** * Lifecycle strip (§32): one cell per stage in funnel order — reached stages filled, the current one accented, * unreached ones hollow; dates and the evidence link (source that moved the project there) under each. * Delayed / cancelled are side branches shown only when reached. */ export function ProjectStages({ stages }: { stages: ProjectStageDTO[] }) { const by = new Map(stages.map((s) => [s.stage, s])); const main = MAIN.map((k) => by.get(k)).filter((s): s is ProjectStageDTO => !!s); const side = SIDE.map((k) => by.get(k)).filter((s): s is ProjectStageDTO => !!s && s.reached); if (!main.length) return
No lifecycle stage recorded.
; return (Velocity needs two dated stages; none of the stage transitions has published dates yet.
}