import { clsx } from 'clsx'; import { useId, useState } from 'react'; import type { Step } from '../../stepper/Stepper'; import BottomSheet from '../../common/bottomSheet'; import Option from '../../common/Option'; import { Check, ChevronDown } from '@transferwise/icons'; import { OverlayIdContext, OverlayIdProvider } from '../../provider/overlay/OverlayIdProvider'; import List from '../../list'; export interface AnimatedLabelProps { activeLabel: number; className?: string; steps: readonly Step[]; } const AnimatedLabel = ({ activeLabel, className, steps }: AnimatedLabelProps) => { const labelId = useId(); const [showSteps, setShowSteps] = useState(false); function handleStepAction(onClick: Step['onClick']) { return () => { setShowSteps(false); onClick?.(); }; } return ( {(overlayId) => { return ( <> setShowSteps(false)} > {steps.map((step, index) => { const isCurrentStep = activeLabel === index; const isDisabled = activeLabel < index; const itemId = `step-${index}`; return ( ); }} ); }; export default AnimatedLabel;