mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-05 23:40:57 +00:00
18 lines
No EOL
499 B
TypeScript
18 lines
No EOL
499 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; |