)
}
@@ -274,15 +280,7 @@ interface InlinePreviewProps {
function InlinePreview({ sound, position }: InlinePreviewProps) {
return (
-
-
-
-
-
-
-
-
-
+
{position + 1}
@@ -292,8 +290,45 @@ function InlinePreview({ sound, position }: InlinePreviewProps) {
{sound.name}
-
- Will be added here
+
+
+ )
+}
+
+// Drag overlay component that shows the dragged item
+interface DragOverlayContentProps {
+ sound: Sound | PlaylistSound
+ position?: number
+}
+
+function DragOverlayContent({ sound, position }: DragOverlayContentProps) {
+ // If position is provided, show as current playlist style
+ if (position !== undefined) {
+ return (
+
- {sounds.map((sound, index) => {
- const adjustedIndex = dropPosition !== null && dropPosition <= index ? index + 1 : index
- return (
-
- {/* Show inline preview if this is the drop position */}
- {dropPosition === index && draggedSound && draggedItem?.startsWith('available-sound-') && (
-
- )}
-
-
- )
- })}
- {/* Show inline preview at the end if that's the drop position */}
- {dropPosition === sounds.length && draggedSound && draggedItem?.startsWith('available-sound-') && (
-
+
+ {sounds.length === 0 ? (
+
+
+
No sounds in playlist
+
Drag sounds here or use + button
+ {/* Show inline preview at position 0 if dragging */}
+ {dropPosition === 0 && draggedSound && draggedItem?.startsWith('available-sound-') && (
+
+ {/* Show inline preview if this is the drop position */}
+ {dropPosition === index && draggedSound && draggedItem?.startsWith('available-sound-') && (
+
+ )}
+
+
+ )
+ })}
+ {/* Show inline preview at the end if that's the drop position */}
+ {dropPosition === sounds.length && draggedSound && draggedItem?.startsWith('available-sound-') && (
+
+ )}
+ {/* Invisible drop area at the end */}
+
+ >
)}
- {/* Invisible drop area at the end */}
-