29 lines
617 B
TypeScript
Raw Normal View History

2017-07-22 18:57:38 +03:00
import React from 'react';
2019-12-07 21:43:08 +02:00
import clsx from 'clsx';
import { Color, COLOR_GREEN } from 'app/components/ui';
2017-07-22 18:57:38 +03:00
import styles from './stepper.scss';
export default function Stepper({
totalSteps,
activeStep,
color = COLOR_GREEN,
}: {
2019-12-07 13:28:52 +02:00
totalSteps: number;
activeStep: number;
color?: Color;
2017-07-22 18:57:38 +03:00
}) {
return (
2019-12-07 21:43:08 +02:00
<div className={clsx(styles.steps, styles[`${color}Steps`])}>
{new Array(totalSteps).fill(0).map((_, step) => (
<div
2019-12-07 21:43:08 +02:00
className={clsx(styles.step, {
[styles.activeStep]: step <= activeStep,
})}
key={step}
/>
))}
</div>
);
2017-08-02 19:20:17 +03:00
}