import { CheckCircle2, Circle, ArrowRight } from 'lucide-react' import type { RuntimeStep } from '@/types' import { cn } from '@/lib/utils' interface StepChecklistProps { steps: RuntimeStep[] currentStepIndex: number completedStepIds: Set onStepClick: (index: number) => void } export function StepChecklist({ steps, currentStepIndex, completedStepIds, onStepClick }: StepChecklistProps) { const procedureSteps = steps.filter((s) => s.type === 'procedure_step') // Pre-compute which steps should show a section header const sectionVisibility = new Set() let prevSection: string | undefined for (let i = 0; i < procedureSteps.length; i++) { const s = procedureSteps[i] const header = 'section_header' in s ? s.section_header : undefined if (header && header !== prevSection) sectionVisibility.add(i) if (header) prevSection = header } return ( ) }