import React, {useEffect} from "react"; import {ActiveDrag} from "./Body.tsx"; import CreateFolderIcon from "../assets/create_folder.svg?react" function DropTarget(props: {children: React.ReactNode, className: string, onDrop: () => void}) { let [drop, setDrop] = React.useState(false); let [activeDrag, _] = React.useContext(ActiveDrag); useEffect(() => { setDrop(false); }, [activeDrag]); function handleDragOver(e: React.DragEvent) { e.preventDefault() setDrop(true) } function handleDragLeave(e: React.DragEvent) { setDrop(false) } function handleDrop(e: React.DragEvent) { e.preventDefault(); props.onDrop(); } return (
{props.children}
); } function DropTargets(props: { onDropLeft: () => void, onDropRight: () => void, onDropCenter: () => void }) { return (
); } export default DropTargets;