accounts-frontend/packages/app/components/ui/stepper/Stepper.tsx

29 lines
711 B
TypeScript
Raw Normal View History

2017-07-22 21:27:38 +05:30
import React from 'react';
2019-12-08 01:13:08 +05:30
import clsx from 'clsx';
import { Color, COLOR_GREEN } from 'app/components/ui';
2017-07-22 21:27:38 +05:30
import styles from './stepper.scss';
export default function Stepper({
2020-05-24 04:38:24 +05:30
totalSteps,
activeStep,
color = COLOR_GREEN,
}: {
2020-05-24 04:38:24 +05:30
totalSteps: number;
activeStep: number;
color?: Color;
2017-07-22 21:27:38 +05:30
}) {
2020-05-24 04:38:24 +05:30
return (
<div className={clsx(styles.steps, styles[`${color}Steps`])}>
{new Array(totalSteps).fill(0).map((_, step) => (
<div
className={clsx(styles.step, {
[styles.activeStep]: step <= activeStep,
})}
key={step}
/>
))}
</div>
);
2017-08-02 21:50:17 +05:30
}