import React from 'react' ; export type ErrorState = Error | null ; export function createErrorInitialState ( ) { return null ; } export function createSnackbarInitialState ( ) { return { visible : false , message : '' , label : 'Done' , } ; } type SnackbarState = ReturnType < typeof createSnackbarInitialState > ; export enum Status { LOADING = 'loading' , FIRST_OPEN = 'firstOpen' , UN_AUTHORIZED = 'unAuthorized' , AUTHORIZED = 'authorized' } export function createApplicationInitialState ( ) { return Status . LOADING ; } export const Context = React . createContext ( { error : createErrorInitialState ( ) , setError : ( _ ) => { } , snackbar : createSnackbarInitialState ( ) , setSnackbar : ( _ ) => { } , applicationState : createApplicationInitialState ( ) , setApplicationState : ( _ ) => { } , } ) ;