mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-02 21:50:10 +00:00
18 lines
492 B
TypeScript
18 lines
492 B
TypeScript
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;
|