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

29 lines
617 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({
totalSteps,
activeStep,
color = COLOR_GREEN,
}: {
2019-12-07 16:58:52 +05:30
totalSteps: number;
activeStep: number;
color?: Color;
2017-07-22 21:27:38 +05:30
}) {
return (
2019-12-08 01:13:08 +05:30
<div className={clsx(styles.steps, styles[`${color}Steps`])}>
{new Array(totalSteps).fill(0).map((_, step) => (
<div
2019-12-08 01:13:08 +05:30
className={clsx(styles.step, {
[styles.activeStep]: step <= activeStep,
})}
key={step}
/>
))}
</div>
);
2017-08-02 21:50:17 +05:30
}