diff --git a/apps/web/src/components/editor/media-panel/views/media.tsx b/apps/web/src/components/editor/media-panel/views/media.tsx index 5438737f..f8cbb639 100644 --- a/apps/web/src/components/editor/media-panel/views/media.tsx +++ b/apps/web/src/components/editor/media-panel/views/media.tsx @@ -3,7 +3,7 @@ import { useDragDrop } from "@/hooks/use-drag-drop"; import { processMediaFiles } from "@/lib/media-processing"; import { useMediaStore, type MediaItem } from "@/stores/media-store"; -import { Image, Music, Plus, Upload, Video } from "lucide-react"; +import { Image, Loader2, Music, Plus, Upload, Video } from "lucide-react"; import { useEffect, useRef, useState } from "react"; import { toast } from "sonner"; import { Button } from "@/components/ui/button"; @@ -203,9 +203,6 @@ export function MediaView() { className={`h-full flex flex-col gap-1 transition-colors relative ${isDragOver ? "bg-accent/30" : ""}`} {...dragProps} > - {/* Show overlay when dragging files over the panel */} - -
{/* Search and filter controls */}
@@ -227,47 +224,45 @@ export function MediaView() { value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} /> +
- {/* Show message if no media, otherwise show media grid */} - {filteredMediaItems.length === 0 ? ( -
-
- -
-

- No media in project -

-

- Drag files here or use the button below -

- -
+ {(isDragOver || filteredMediaItems.length === 0) ? ( + ) : (
void; + isEmptyState?: boolean; } export function DragOverlay({ isVisible, title = "Drop files here", description = "Images, videos, and audio files", + isProcessing = false, + progress = 0, + onClick, + isEmptyState = false, }: DragOverlayProps) { if (!isVisible) return null; + const handleClick = (e: React.MouseEvent) => { + if (isProcessing || !onClick) return; + e.preventDefault(); + e.stopPropagation(); + onClick(); + }; + return ( -
-
- -

{title}

-

{description}

+
+
+ {isProcessing ? ( + + ) : isEmptyState ? ( + + ) : ( + + )}
+ +
+

+ {isProcessing ? "Processing files..." : title} +

+

+ {isProcessing + ? `Processing your files (${progress}%)` + : description + } +

+
+ + {!isProcessing && ( +
+ +

+ {isEmptyState + ? "Supports images, videos, and audio files" + : "Or drop your files here" + } +

+
+ )} + + {isProcessing && ( +
+
+
+
+
+ )}
); }