import React, { useCallback, ComponentPropsWithoutRef } from 'react'; import { stepTheme, StepTheme } from './Step.theme'; import { CheckRoundFilledIcon, ChevronRight, } from 'components/shared/CustomIcon'; export interface StepProps extends ComponentPropsWithoutRef<'li'>, StepTheme { /** * The label for the step */ label: string; /** * The index of the step */ index: number; /** * The total number of steps */ currentIndex: number; } export const Step = ({ label, index, currentIndex, orientation, ...props }: StepProps) => { const theme = stepTheme(); const active = currentIndex === index; const completed = currentIndex > index; const renderConnector = useCallback( (index: number) => { if (index === 1) { return null; } return (
{orientation === 'horizontal' && }
); }, [orientation, theme], ); return ( <> {renderConnector(index)}
  • {
    {completed ? ( ) : ( index )}
    }

    {label}

  • ); };