import { Gridicon } from '@automattic/components'; import clsx from 'clsx'; import { Fragment } from 'react'; type Props = { steps: string[]; current: number; }; function getStepClassName( currentStep: number, step: number ): string { return clsx( { 'is-current': currentStep === step, 'is-next': currentStep < step, 'is-complete': currentStep > step, } ); } function Marker( { currentStep, step }: { currentStep: number; step: number } ) { if ( currentStep > step ) { return ( ); } return ( { step } ); } export default function LayoutStepper( { steps, current }: Props ) { return (
{ steps.map( ( label, index ) => (
{ label }
{ index < steps.length - 1 && (
) } ) ) }
); }