import classNames from 'classnames'; import { type FunctionComponent, type HTMLProps } from 'react'; import { PROGRESS_COLOR_BACKGROUND, PROGRESS_COLOR_VALUE } from 'parameters'; import { selectLocale, useTypedSelector } from 'state'; import styles from './Progress.module.scss'; interface Props extends HTMLProps { max: number; min?: number; value: number; } const getGradient = (progress: number, color: string, background: string) => { const percent = 100 * progress; return `linear-gradient(90deg, ${color} 0%, ${color} ${percent}%, ${background} ${percent}%, ${background} 100%)`; }; export const Progress: FunctionComponent = ({ className, max, min = 0, style, value, ...props }) => { const locale = useTypedSelector(selectLocale); const progress = value / (max - min); const percent = Math.round(100 * progress); return (
); };