You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/components/Stepper/Stepper.tsx

34 lines
778 B

import clsx from 'clsx';
import styles from './Stepper.module.css';
export interface Step {
label: string;
}
interface Props {
currentStep: number;
steps: Step[];
}
export function Stepper({ currentStep, steps }: Props) {
return (
<div className={styles.stepperWrapper}>
{steps.map((step, index) => (
<div
key={step.label}
className={clsx(styles.stepWrapper, {
[styles.active]: index + 1 === currentStep,
[styles.completed]: index + 1 < currentStep,
})}
>
<div className={styles.step}>
<div className={styles.stepCounter}>{index + 1}</div>
<div className={styles.stepName}>{step.label}</div>
</div>
</div>
))}
</div>
);
}