aboutsummaryrefslogtreecommitdiff
path: root/apps/web/lib/context.ts
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-06-30 20:50:24 -0500
committerDhravya <[email protected]>2024-06-30 20:50:24 -0500
commitffd141ade4e6074ee486da7f74f31e3905807cb9 (patch)
tree505d73b0a7c04cdec93d7f5be88c635642716c15 /apps/web/lib/context.ts
parentshow updates in the extension (diff)
parentMerge pull request #93 from Dhravya/editor (diff)
downloadsupermemory-ffd141ade4e6074ee486da7f74f31e3905807cb9.tar.xz
supermemory-ffd141ade4e6074ee486da7f74f31e3905807cb9.zip
merge conflicts
Diffstat (limited to 'apps/web/lib/context.ts')
-rw-r--r--apps/web/lib/context.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/web/lib/context.ts b/apps/web/lib/context.ts
new file mode 100644
index 00000000..840c0d31
--- /dev/null
+++ b/apps/web/lib/context.ts
@@ -0,0 +1,18 @@
+import { createContext, useContext } from "react";
+
+export interface DragContextType {
+ isDraggingOver: boolean;
+ setIsDraggingOver: React.Dispatch<React.SetStateAction<boolean>>;
+}
+
+const DragContext = createContext<DragContextType | undefined>(undefined);
+
+export const useDragContext = () => {
+ const context = useContext(DragContext);
+ if (context === undefined) {
+ throw new Error("useAppContext must be used within an AppProvider");
+ }
+ return context;
+};
+
+export default DragContext;