aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/modules/modals/ModalContext.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/modules/modals/ModalContext.ts')
-rw-r--r--frontend/src/modules/modals/ModalContext.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/frontend/src/modules/modals/ModalContext.ts b/frontend/src/modules/modals/ModalContext.ts
new file mode 100644
index 000000000..81e7fba86
--- /dev/null
+++ b/frontend/src/modules/modals/ModalContext.ts
@@ -0,0 +1,14 @@
+import { createContext, Dispatch, SetStateAction } from "react";
+
+export interface ModalData {
+ key: string;
+ closeable: boolean;
+ size: "sm" | "lg" | "xl" | undefined;
+}
+
+export type ModalSetter = {
+ [P in keyof Omit<ModalData, "key">]: Dispatch<SetStateAction<ModalData[P]>>;
+};
+
+export const ModalDataContext = createContext<ModalData | null>(null);
+export const ModalSetterContext = createContext<ModalSetter | null>(null);