import React, { createContext, useContext, ReactNode } from 'react'; // Define types for drag and drop export interface DragItem { type: 'task'; taskId: string; sourceDay: string; } export interface DropResult { taskId: string; targetDay: string; } // Create context for drag and drop interface DragDropContextType { dragItem: DragItem | null; setDragItem: (item: DragItem | null) => void; onDrop: (result: DropResult) => void; } const DragDropContext = createContext(undefined); // Provider component export const DragDropProvider: React.FC<{ children: ReactNode }> = ({ children }) => { const [dragItem, setDragItem] = React.useState(null); const onDrop = (result: DropResult) => { // This will be implemented by the consumer console.log('Dropped task:', result); }; return ( {children} ); }; // Hook to use drag and drop context export const useDragDrop = () => { const context = useContext(DragDropContext); if (!context) { throw new Error('useDragDrop must be used within a DragDropProvider'); } return context; };