import { Check, X } from 'lucide-react' import { cn, formatDateTime } from '@/lib/utils' export type ApprovalStepState = 'done' | 'current' | 'upcoming' | 'failed' export type ApprovalStep = { key: string label: string state: ApprovalStepState /** Who moved the record into this stage. */ actor?: string at?: string hint?: string } const markerClasses: Record = { done: 'border-brand-500 bg-brand-500 text-white', current: 'border-orange bg-orange/10 text-orange-deep', upcoming: 'border-grayScale-200 bg-grayScale-100 text-grayScale-400', failed: 'border-destructive bg-destructive text-white', } const labelClasses: Record = { done: 'text-foreground', current: 'text-orange-deep', upcoming: 'text-grayScale-400', failed: 'text-destructive', } /** * Horizontal review progress for records that move through an approval * workflow. Stacks to a vertical list below `sm`. */ export function ApprovalStepper({ steps, className }: { steps: ApprovalStep[]; className?: string }) { return (
    {steps.map((step, index) => { const isLast = index === steps.length - 1 const connectorDone = step.state === 'done' return (
  1. {step.state === 'done' ? ( {!isLast ? (

    {step.label}

    {step.actor ? (

    {step.actor}

    ) : null} {step.at ? (

    {formatDateTime(step.at)}

    ) : null} {step.hint ?

    {step.hint}

    : null}
  2. ) })}
) }