added sound context, and functionality to select sighting sound

This commit is contained in:
2025-09-30 14:51:37 +01:00
parent 673df1a4f4
commit 2aeae761f8
9 changed files with 109 additions and 86 deletions

View File

@@ -0,0 +1,18 @@
import { useReducer, type ReactNode } from "react";
import { SoundContext } from "../SoundContext";
import { initalState, reducer } from "../reducers/SoundContextReducer";
type SoundContextProviderProps = {
children: ReactNode;
};
const SoundContextProvider = ({ children }: SoundContextProviderProps) => {
const [state, dispatch] = useReducer(reducer, initalState);
return (
<SoundContext.Provider value={{ state, dispatch }}>
{children}
</SoundContext.Provider>
);
};
export default SoundContextProvider;