diff --git a/src/components/CustomDragLayer.tsx b/src/components/CustomDragLayer.tsx index cd59376..b53bce5 100644 --- a/src/components/CustomDragLayer.tsx +++ b/src/components/CustomDragLayer.tsx @@ -1,10 +1,14 @@ -import { TFile } from "obsidian"; import { useDragLayer } from "react-dnd"; +import { + FFS_DRAG_FILES_TYPE, + FFS_DRAG_FOLDER_TYPE, +} from "src/assets/constants"; const CustomDragLayer = () => { - const { isDragging, item, currentOffset } = useDragLayer((monitor) => ({ + const { isDragging, currentOffset, itemType } = useDragLayer((monitor) => ({ isDragging: monitor.isDragging(), item: monitor.getItem(), + itemType: monitor.getItemType(), currentOffset: monitor.getClientOffset(), })); @@ -12,6 +16,14 @@ const CustomDragLayer = () => { return null; } + const renderDraggingIcon = () => { + if (itemType === FFS_DRAG_FOLDER_TYPE) { + return "📁"; + } else if (itemType === FFS_DRAG_FILES_TYPE) { + return "📄"; + } + }; + return (