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 getVolumeOption = (soundCategory: string) => { if (soundCategory === "SIGHTINGVOLUME") { return state.sightingVolume; } if (soundCategory === "NPEDVOLUME") { return state.NPEDsoundVolume; } if (soundCategory === "HOTLISTVOLUME") { return state.hotlistSoundVolume; } }; const volume = getVolumeOption(soundCategory); const handleChange = (value: number | number[]) => { const number = typeof value === "number" ? value : value[0]; dispatch({ type: soundCategory, payload: number }); }; return (