import { type CSSProperties, type ReactNode } from "react"; import { LockKeyhole, type LucideIcon } from "lucide-react"; import { Card, InlineHelp, StageRail, i18nMessage, type StageRailTone } from "@govoplan/core-webui"; import { humanize } from "../utils/campaignView"; export type FlowState = | "complete" | "warning" | "danger" | "active" | "locked" | "running" | "partial" | "stale" | "pending"; export type FlowStageDefinition = { id: string; title: string; shortTitle: string; description: string; icon: LucideIcon; state: FlowState; connectorState?: FlowState; stateLabel: string; lockReason?: string; }; const stateColors: Record = { complete: "var(--green)", warning: "var(--amber)", danger: "var(--red)", active: "var(--blue)", locked: "var(--line-dark)", running: "var(--blue)", partial: "var(--review-flow-partial)", stale: "var(--review-flow-partial)", pending: "var(--muted)" }; const stageRailTones: Record = { complete: "success", warning: "warning", danger: "danger", active: "active", locked: "neutral", running: "active", partial: "partial", stale: "partial", pending: "neutral" }; export function WorkflowNavigation({ stages, onSelect }: { stages: FlowStageDefinition[]; onSelect: (id: string) => void; }) { return ( { const Icon = stage.icon; const title = i18nMessage(stage.title); const stateText = i18nMessage(stage.stateLabel); return { id: stage.id, label: i18nMessage(stage.shortTitle), statusLabel: ["active", "locked"].includes(stage.state) ? undefined : stateText, title: `${title}: ${stateText}`, icon: