mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-15 18:25:18 +02:00
refactor: simplify audio component by removing dropdown menu and integrating download button directly
This commit is contained in:
parent
fed3a3b436
commit
009e89e5cd
1 changed files with 9 additions and 24 deletions
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DownloadIcon,
|
DownloadIcon,
|
||||||
EllipsisVerticalIcon,
|
|
||||||
PauseIcon,
|
PauseIcon,
|
||||||
PlayIcon,
|
PlayIcon,
|
||||||
Volume2Icon,
|
Volume2Icon,
|
||||||
|
|
@ -10,12 +9,6 @@ import {
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
|
||||||
DropdownMenu,
|
|
||||||
DropdownMenuContent,
|
|
||||||
DropdownMenuItem,
|
|
||||||
DropdownMenuTrigger,
|
|
||||||
} from "@/components/ui/dropdown-menu";
|
|
||||||
import { Slider } from "@/components/ui/slider";
|
import { Slider } from "@/components/ui/slider";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
|
@ -189,23 +182,15 @@ export function Audio({ id, src, title, durationMs, className }: AudioProps) {
|
||||||
|
|
||||||
<div className="flex items-start gap-2 px-5 pt-5 pb-4">
|
<div className="flex items-start gap-2 px-5 pt-5 pb-4">
|
||||||
<p className="text-sm font-semibold text-foreground line-clamp-2 flex-1 min-w-0">{title}</p>
|
<p className="text-sm font-semibold text-foreground line-clamp-2 flex-1 min-w-0">{title}</p>
|
||||||
<DropdownMenu>
|
|
||||||
<DropdownMenuTrigger asChild>
|
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
|
onClick={handleDownload}
|
||||||
className="size-7 shrink-0 -mt-0.5 -mr-2 text-muted-foreground"
|
className="size-7 shrink-0 -mt-0.5 -mr-2 text-muted-foreground"
|
||||||
|
aria-label="Download audio"
|
||||||
>
|
>
|
||||||
<EllipsisVerticalIcon className="size-4" />
|
|
||||||
</Button>
|
|
||||||
</DropdownMenuTrigger>
|
|
||||||
<DropdownMenuContent align="end">
|
|
||||||
<DropdownMenuItem onClick={handleDownload}>
|
|
||||||
<DownloadIcon className="size-4" />
|
<DownloadIcon className="size-4" />
|
||||||
Download
|
</Button>
|
||||||
</DropdownMenuItem>
|
|
||||||
</DropdownMenuContent>
|
|
||||||
</DropdownMenu>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mx-5 h-px bg-border/50" />
|
<div className="mx-5 h-px bg-border/50" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue