misc_pterodactyl-panel/resources/scripts/context/ModalContext.ts
2022-11-25 13:25:03 -07:00

21 lines
564 B
TypeScript

import { createContext } from 'react';
import { SettableModalProps } from '@/hoc/asModal';
export interface ModalContextValues {
dismiss: () => void;
setPropOverrides: (
value:
| ((current: Readonly<Partial<SettableModalProps>>) => Partial<SettableModalProps>)
| Partial<SettableModalProps>
| null,
) => void;
}
const ModalContext = createContext<ModalContextValues>({
dismiss: () => null,
setPropOverrides: () => null,
});
ModalContext.displayName = 'ModalContext';
export default ModalContext;