import {createContext, useContext} from 'react' type AppConfigResponse = { liveNow: { allow: string[] exceptions: { did: string allow: string[] }[] } } export const DEFAULT_APP_CONFIG_RESPONSE: AppConfigResponse = { liveNow: { allow: [], exceptions: [], }, } const Context = createContext(DEFAULT_APP_CONFIG_RESPONSE) export function Provider({children}: React.PropsWithChildren<{}>) { return ( {children} ) } export async function prefetchAppConfig() {} export function useAppConfig() { const ctx = useContext(Context) if (!ctx) { throw new Error('useAppConfig must be used within a Provider') } return ctx }