"use client"; import type { Phase } from "@/lib/types"; const PHASES: Phase[] = ["plan", "decompose", "drill", "cross_check", "critique", "report"]; const LABELS: Record = { plan: "Plan", decompose: "Decompose", drill: "Drill", cross_check: "X-Check", critique: "Critique", report: "Report", }; const DESCRIPTIONS: Record = { plan: "Frame the question and choose the first checks.", decompose: "Break the metric into likely drivers and segments.", drill: "Investigate the strongest candidate causes in detail.", cross_check: "Verify the explanation against alternate slices.", critique: "Check whether the evidence is strong enough.", report: "Summarize the answer, evidence, and next steps.", }; interface Props { currentPhase: Phase | null; completedPhases: Phase[]; } export default function PhaseTimeline({ currentPhase, completedPhases }: Props) { return (
{PHASES.map((phase, i) => { const isDone = completedPhases.includes(phase) && phase !== currentPhase; const isActive = phase === currentPhase; const tooltipAlign = i === 0 ? "left-0" : i === PHASES.length - 1 ? "right-0" : "left-1/2 -translate-x-1/2"; return (
{LABELS[phase]} {currentPhase && ( )}
{i < PHASES.length - 1 && (
)}
); })}
); }