import { Dispatch, SetStateAction, createContext, useContext } from 'react'; import { AnimationConfig } from '@/components/AnimateItems'; export interface AppStateContext { previousPathname?: string hasLoaded?: boolean swrTimestamp?: number invalidateSwr?: () => void userEmail?: string setUserEmail?: Dispatch> isUserSignedIn?: boolean setHasLoaded?: Dispatch> nextPhotoAnimation?: AnimationConfig setNextPhotoAnimation?: Dispatch> shouldRespondToKeyboardCommands?: boolean setShouldRespondToKeyboardCommands?: Dispatch> isCommandKOpen?: boolean setIsCommandKOpen?: Dispatch> adminUpdateTimes?: Date[] registerAdminUpdate?: () => void shouldShowBaselineGrid?: boolean setShouldShowBaselineGrid?: Dispatch> shouldDebugBlur?: boolean setShouldDebugBlur?: Dispatch> clearNextPhotoAnimation?: () => void } export const AppStateContext = createContext({}); export const useAppState = () => useContext(AppStateContext);