import React from "react"; import { HStack } from "../../../primitives/stack"; import { cl } from "../../../utils/helpers"; import { DragAndDropDragHandler } from "../drag-handler/DragAndDropDragHandler"; import { useDragAndDropContext } from "../root/DragAndDrop.context"; interface DragAndDropItemProps extends React.HTMLAttributes { children: React.ReactNode; /** * Unique id */ id: string; /** * Index of the item being dragged */ index: number; /** * Indicates if the item is an overlay */ isOverlay?: boolean; } /** * TODO * * @see 🏷️ {@link DragAndDropItemProps} * @example * ```tsx * * TODO * * ``` */ const DragAndDropItem = React.forwardRef( ( { children, id, index, className, isOverlay = false, ...rest }, forwardedRef, ) => { const ref = React.useRef(null); const context = useDragAndDropContext(); const item = { id, index }; const isDropTarget = context?.dropTarget?.id === id; return ( {/* TODO Should this be a
  • ? */}
    {children}
    ); }, ); export default DragAndDropItem; export { DragAndDropItem }; export type { DragAndDropItemProps };