chitchatter/src/ShellContext.ts

18 lines
489 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
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,
setNumberOfPeers: () => {},
setTitle: () => {},
showAlert: () => {},
2022-08-28 21:25:49 -05:00
})