import RcSlider from 'rc-slider'; import styles from './Slider.module.css'; import 'rc-slider/assets/index.css'; export interface Props { min: number; max: number; step: number; value: number; onChange: (value: number) => void; } export function Slider({ min, max, step, value, onChange }: Props) { const SliderWithTooltip = RcSlider.createSliderWithTooltip(RcSlider); const marks = { [min]: translateMinValue(min), [max]: max.toString(), }; return (
); } function translateMinValue(value: number) { if (value === 0) { return 'unlimited'; } return value.toString(); }