refactor: move the add button below the placeholder text

This commit is contained in:
Nizav
2025-07-14 22:46:28 +07:00
parent b54c5443a0
commit acd42a29f6
@@ -207,9 +207,8 @@ export function MediaView() {
<DragOverlay isVisible={isDragOver} /> <DragOverlay isVisible={isDragOver} />
<div className="p-3 pb-2"> <div className="p-3 pb-2">
{/* Button to add/upload media */} {/* Search and filter controls (removed old Add button) */}
<div className="flex gap-2"> <div className="flex gap-2">
{/* Search and filter controls */}
<Select value={mediaFilter} onValueChange={setMediaFilter}> <Select value={mediaFilter} onValueChange={setMediaFilter}>
<SelectTrigger className="w-[80px] h-full text-xs"> <SelectTrigger className="w-[80px] h-full text-xs">
<SelectValue /> <SelectValue />
@@ -228,29 +227,6 @@ export function MediaView() {
value={searchQuery} value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)} onChange={(e) => setSearchQuery(e.target.value)}
/> />
{/* Add media button */}
<Button
variant="outline"
size="sm"
onClick={handleFileSelect}
disabled={isProcessing}
className="flex-none bg-transparent min-w-[30px] whitespace-nowrap overflow-hidden px-2 justify-center items-center"
>
{isProcessing ? (
<>
<Upload className="h-4 w-4 animate-spin" />
<span className="hidden md:inline ml-2">{progress}%</span>
</>
) : (
<>
<Plus className="h-4 w-4" />
<span className="hidden sm:inline ml-2" aria-label="Add file">
Add
</span>
</>
)}
</Button>
</div> </div>
</div> </div>
@@ -265,8 +241,29 @@ export function MediaView() {
No media in project No media in project
</p> </p>
<p className="text-xs text-muted-foreground/70 mt-1"> <p className="text-xs text-muted-foreground/70 mt-1">
Drag files here or use the button above Drag files here or use the button below
</p> </p>
<Button
variant="outline"
size="sm"
onClick={handleFileSelect}
disabled={isProcessing}
className="flex-none bg-transparent min-w-[30px] whitespace-nowrap overflow-hidden px-2 justify-center items-center mt-2"
>
{isProcessing ? (
<>
<Upload className="h-4 w-4 animate-spin" />
<span className="hidden md:inline ml-2">{progress}%</span>
</>
) : (
<>
<Plus className="h-4 w-4" />
<span className="hidden sm:inline ml-2" aria-label="Add file">
Add
</span>
</>
)}
</Button>
</div> </div>
) : ( ) : (
<div <div