chitchatter/src/contexts/ShellContext.ts

20 lines
569 B
TypeScript
Raw Normal View History

2022-08-28 21:25:49 -05:00
import { createContext, Dispatch, SetStateAction } from 'react'
import { AlertOptions } from 'models/shell'
2022-08-28 21:25:49 -05:00
interface ShellContextProps {
2022-08-29 22:05:56 -05:00
numberOfPeers: number
2022-09-01 21:28:45 -05:00
setDoShowPeers: Dispatch<SetStateAction<boolean>>
setNumberOfPeers: Dispatch<SetStateAction<number>>
setTitle: Dispatch<SetStateAction<string>>
showAlert: (message: string, options?: AlertOptions) => void
2022-08-28 21:25:49 -05:00
}
export const ShellContext = createContext<ShellContextProps>({
2022-08-29 22:05:56 -05:00
numberOfPeers: 1,
2022-09-01 21:28:45 -05:00
setDoShowPeers: () => {},
setNumberOfPeers: () => {},
setTitle: () => {},
showAlert: () => {},
2022-08-28 21:25:49 -05:00
})