import { useMemo, useReducer, type ReactNode } from "react"; import { SoundContext } from "../SoundContext"; import { initialState, reducer } from "../reducers/SoundContextReducer"; type SoundContextProviderProps = { children: ReactNode; }; const SoundContextProvider = ({ children }: SoundContextProviderProps) => { const [state, dispatch] = useReducer(reducer, initialState); const value = useMemo(() => ({ state, dispatch }), [state, dispatch]); return ( {children} ); }; export default SoundContextProvider;