import { BubbleStep, BubbleStepType, InputStep, InputStepType } from 'models' import { createContext, Dispatch, ReactNode, SetStateAction, useContext, useState, } from 'react' export type DraggableStep = BubbleStep | InputStep export type DraggableStepType = BubbleStepType | InputStepType const dndContext = createContext<{ draggedStepType?: DraggableStepType setDraggedStepType: Dispatch> draggedStep?: DraggableStep setDraggedStep: Dispatch> }>({ setDraggedStep: () => console.log("I'm not implemented"), setDraggedStepType: () => console.log("I'm not implemented"), }) export const DndContext = ({ children }: { children: ReactNode }) => { const [draggedStep, setDraggedStep] = useState() const [draggedStepType, setDraggedStepType] = useState< DraggableStepType | undefined >() return ( {children} ) } export const useDnd = () => useContext(dndContext)