import React from 'react' export interface StepperStep { label: string } export interface StepperProps { steps: StepperStep[] currentStep: number compact?: boolean className?: string } export const Stepper: React.FC = ({ steps, currentStep, compact = false, className = '' }) => (
{steps.map((step, i) => { const num = i + 1 const isDone = num < currentStep const isCurrent = num === currentStep const lineAfter = i < steps.length - 1 const active = isDone || isCurrent return (
{isDone ? ( check ) : ( {num} )}
{!compact && ( {step.label} )}
{lineAfter && (
)} ) })}
)