import { CameraSettingsContext } from "../context/CameraSettingsContext";
import { useReducer, type ReactNode } from "react";
import { initialState, cameraSettingsReducer } from "../reducers/cameraSettingsReducer";

const CameraSettingsProvider = ({ children }: { children: ReactNode }) => {
  const [state, dispatch] = useReducer(cameraSettingsReducer, initialState);

  return <CameraSettingsContext.Provider value={{ state, dispatch }}>{children}</CameraSettingsContext.Provider>;
};

export default CameraSettingsProvider;
