import { Check, Circle, GitBranch } from 'lucide-react' import { PhaseBadge } from '@/components/PhaseBadge' import { ContractPhaseLabel } from '@/types/contracts' import type { WorkflowSummary } from '@/types/contracts' import { cn } from '@/lib/cn' // Shows the active WorkflowPolicy (Standard / SkipCcm / …) as a timeline of // phases with the current one highlighted. Drafter + approvers see clearly // "where we are" and "what comes next" — no more mental mapping of enum ints. export function WorkflowSummaryCard({ workflow, currentPhase, }: { workflow: WorkflowSummary currentPhase: number }) { const currentIdx = workflow.activePhases.indexOf(currentPhase) return (

Quy trình: {workflow.policyName}

{workflow.policyDescription}

    {workflow.activePhases.map((phase, idx) => { const isDone = currentIdx >= 0 && idx < currentIdx const isCurrent = phase === currentPhase const isFuture = currentIdx >= 0 && idx > currentIdx return (
  1. {isDone ? : isCurrent ? : idx + 1}
    {ContractPhaseLabel[phase] ?? `Phase ${phase}`}
    {isCurrent && }
  2. ) })}
) }