import { Check, FileSignature, FileText, ShieldCheck, Truck, Workflow, type LucideIcon, } from "lucide-react"; import { Paper, Group, Stack, Text, Box } from "@mantine/core"; import { CONTRACT_WORKFLOW_STAGES, getContractWorkflowStageIndex, } from "@/features/contracts/contract-status.config"; import { SectionCard } from "@/components/bookings/detail/SectionCard"; import { BRAND_GREEN, detailStyles, } from "@/components/bookings/detail/booking-detail.styles"; const STAGE_ICONS: LucideIcon[] = [ FileText, FileSignature, FileSignature, ShieldCheck, Truck, Check, ]; interface ContractWorkflowStepperProps { status: string; title: string; description: string; } export function ContractWorkflowStepper({ status, title, description, }: ContractWorkflowStepperProps) { const currentStage = getContractWorkflowStageIndex(status); const isTerminal = currentStage < 0; return ( {CONTRACT_WORKFLOW_STAGES.map((stage, index) => { const Icon = STAGE_ICONS[index] ?? FileText; const isComplete = !isTerminal && index < currentStage; const isActive = !isTerminal && index === currentStage; const isLast = index === CONTRACT_WORKFLOW_STAGES.length - 1; return ( {isComplete ? ( ) : ( )} {stage.label} {!isLast && ( )} ); })} {title} {description} ); }