misc_pterodactyl-panel/resources/scripts/context/ModalContext.ts

22 lines
564 B
TypeScript
Raw Permalink Normal View History

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