From f76169ada15cff51dbf9ce3af148a78c46ed36c6 Mon Sep 17 00:00:00 2001 From: Simon Orzel Date: Wed, 16 Jul 2025 00:48:00 +0200 Subject: feat: refactors media drag overlay and media tab --- apps/web/src/components/ui/drag-overlay.tsx | 78 ++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 6 deletions(-) (limited to 'apps/web/src/components/ui') diff --git a/apps/web/src/components/ui/drag-overlay.tsx b/apps/web/src/components/ui/drag-overlay.tsx index ba6fe08f..eb190e89 100644 --- a/apps/web/src/components/ui/drag-overlay.tsx +++ b/apps/web/src/components/ui/drag-overlay.tsx @@ -1,25 +1,91 @@ -import { Upload } from "lucide-react"; +import { Upload, Plus, Image } from "lucide-react"; +import { Button } from "@/components/ui/button"; interface DragOverlayProps { isVisible: boolean; title?: string; description?: string; + isProcessing?: boolean; + progress?: number; + onClick?: () => 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 && ( +
+
+
+
+
+ )}
); } -- cgit v1.3.1