import "rc-slider/assets/index.css"; import Slider from "rc-slider"; import { useSoundContext } from "../../context/SoundContext"; const SliderComponent = ({ soundCategory }: { soundCategory: "SIGHTINGVOLUME" | "NPEDVOLUME" | "HOTLISTVOLUME" }) => { const { dispatch, state } = useSoundContext(); const volume = soundCategory === "SIGHTINGVOLUME" ? state.sightingVolume : state.NPEDsoundVolume; const handleChange = (value: number | number[]) => { const number = typeof value === "number" ? value : value[0]; dispatch({ type: soundCategory, payload: number }); }; return (
{volume * 10}
); }; export default SliderComponent;