import Slider from "rc-slider";
import "rc-slider/assets/index.css";

type SliderComponentProps = {
  id: string;
  onChange: (value: number | number[]) => void;
  value?: number;
  min?: number;
  max?: number;
  step?: number;
};

const SliderComponent = ({ id, onChange, value = 0, min = 0, max = 100, step = 1 }: SliderComponentProps) => {
  const handleChange = (val: number | number[]) => onChange(val);

  return <Slider id={id} onChange={handleChange} value={value} min={min} max={max} step={step} />;
};

export default SliderComponent;
