2017-07-22 18:57:38 +03:00
|
|
|
import React from 'react';
|
2019-12-07 21:43:08 +02:00
|
|
|
import clsx from 'clsx';
|
2019-12-07 21:02:00 +02:00
|
|
|
import { Color, COLOR_GREEN } from 'app/components/ui';
|
2017-08-04 22:27:02 +03:00
|
|
|
|
2017-07-22 18:57:38 +03:00
|
|
|
import styles from './stepper.scss';
|
|
|
|
|
|
|
|
export default function Stepper({
|
2020-05-24 02:08:24 +03:00
|
|
|
totalSteps,
|
|
|
|
activeStep,
|
|
|
|
color = COLOR_GREEN,
|
2017-09-09 18:04:26 +03:00
|
|
|
}: {
|
2020-05-24 02:08:24 +03:00
|
|
|
totalSteps: number;
|
|
|
|
activeStep: number;
|
|
|
|
color?: Color;
|
2017-07-22 18:57:38 +03:00
|
|
|
}) {
|
2020-05-24 02:08:24 +03:00
|
|
|
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 19:20:17 +03:00
|
|
|
}
|