({
currentStep,
totalSteps,
setCurrentStep,
})
| 58 | } |
| 59 | |
| 60 | const ProgressCircles: FC<ProgressCirclesProps> = ({ |
| 61 | currentStep, |
| 62 | totalSteps, |
| 63 | setCurrentStep, |
| 64 | }) => { |
| 65 | // Number of circles to show at a time |
| 66 | const maxVisibleCircles = 8; |
| 67 | |
| 68 | // Start index of the circles to show |
| 69 | const start = Math.max(0, currentStep - Math.floor(maxVisibleCircles / 2)); |
| 70 | |
| 71 | return ( |
| 72 | <div className="flex flex-row items-center justify-center gap-x-2"> |
| 73 | {Array.from(Array(maxVisibleCircles).keys()).map((index) => { |
| 74 | const step = start + index; |
| 75 | // TODO: Add slide transition to the progress circles, like a carousel |
| 76 | return ( |
| 77 | step < totalSteps && ( |
| 78 | <ProgressCircle |
| 79 | key={step} |
| 80 | isCompleted={step < currentStep} |
| 81 | isCurrent={step === currentStep} |
| 82 | onClick={() => setCurrentStep(step)} |
| 83 | /> |
| 84 | ) |
| 85 | ); |
| 86 | })} |
| 87 | </div> |
| 88 | ); |
| 89 | }; |
| 90 | |
| 91 | const TutorialDialog: FC<TutorialProps> = ({ |
| 92 | show: isTutorialOpen, |
nothing calls this directly
no outgoing calls
no test coverage detected