diff options
| author | Dhravya <[email protected]> | 2024-06-30 20:50:24 -0500 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-06-30 20:50:24 -0500 |
| commit | ffd141ade4e6074ee486da7f74f31e3905807cb9 (patch) | |
| tree | 505d73b0a7c04cdec93d7f5be88c635642716c15 /apps/web/lib/context.ts | |
| parent | show updates in the extension (diff) | |
| parent | Merge pull request #93 from Dhravya/editor (diff) | |
| download | supermemory-ffd141ade4e6074ee486da7f74f31e3905807cb9.tar.xz supermemory-ffd141ade4e6074ee486da7f74f31e3905807cb9.zip | |
merge conflicts
Diffstat (limited to 'apps/web/lib/context.ts')
| -rw-r--r-- | apps/web/lib/context.ts | 18 |
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; |