import { Gridicon } from '@automattic/components'; import clsx from 'clsx'; import { useTranslate } from 'i18n-calypso'; import { Fragment } from 'react'; import type { SiteDetails } from '@automattic/data-stores'; import './style.scss'; function getStepClassName( currentStep: number, step: number ) { return clsx( { 'step-current': currentStep === step, 'step-next': currentStep < step, 'step-complete': currentStep > step, } ); } function CheckMarkOrNumber( { currentStep, step }: { currentStep: number; step: number } ) { if ( currentStep > step ) { return ( ); } return ( { step } ); } type StepKey = 'destination' | 'clonePoint' | 'configure'; interface Step { key: StepKey; label: string; } interface Props { currentStep: StepKey; selectedSite?: SiteDetails | null; } export default function CloneFlowStepProgress( { currentStep }: Props ) { const translate = useTranslate(); const steps: Step[] = [ { key: 'destination', label: translate( 'Set destination' ) }, { key: 'clonePoint', label: translate( 'Select point to copy' ) }, { key: 'configure', label: translate( 'Configure' ) }, ]; const currentStepIndex = Math.max( steps.findIndex( ( step ) => step.key === currentStep ), 0 ); return (
{ steps.map( ( { key, label }, index ) => (
{ label }
{ index < steps.length - 1 && (
) } ) ) }
); }