import { createContext, useContext } from "react"; import { ConfigContextProps } from "./types"; const ConfigContext = createContext({} as ConfigContextProps); const useConfigContext = () => { const context = useContext(ConfigContext); if (context === undefined) { throw new Error( "useConfigContext must be used within an ConfigContext.Provider", ); } return context; }; export { useConfigContext, ConfigContext };