type StepState = 'idle' | 'active' | 'done'; interface Step { label: string; state: StepState; } interface StepperProps { steps: Step[]; } function StepMarker({ state, index }: { state: StepState; index: number }) { if (state === 'done') { return ( ); } return ( ); } export function Stepper({ steps }: StepperProps) { return (
{steps.map((step, index) => { const isLast = index === steps.length - 1; const nextStepDone = !isLast && steps[index].state === 'done'; return (
{step.label}
{!isLast ?
: null}
); })}
); }