Skip to content

Commit

Permalink
Audio preview delete and download working
Browse files Browse the repository at this point in the history
  • Loading branch information
aamirazad committed Jul 25, 2024
1 parent 05cb715 commit 3d8c63a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
Binary file modified bun.lockb
100644 → 100755
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio",
"dev": "next dev",
"dev": "next dev --turbo",
"lint": "next lint",
"start": "next start"
},
Expand Down
44 changes: 26 additions & 18 deletions src/components/audio-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ import {
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";

const queryClient = new QueryClient();

Expand Down Expand Up @@ -203,24 +209,26 @@ function AudioInfo({ id }: AudioInfoProps) {
Open
</OpenExternalLink>
</Button>
<a
href={`${userData.whishperURL}/api/video/${recordingData.fileName}`}
download={recordingData.fileName}
className={`w-24 ${buttonVariants({ variant: "default" })}`}
target="_blank"
>
Download
</a>
<Button
onClick={async () => {
await downloadWhishperRecording(
`${userData.whishperURL}/api/video/${recordingData.fileName}`,
recordingData.fileName,
);
}}
>
Download
</Button>
<TooltipProvider delayDuration={0}>
<Tooltip>
<TooltipTrigger>
<a
href={`${userData.whishperURL}/api/video/${recordingData.fileName}`}
download={recordingData.fileName}
className={`w-24 ${buttonVariants({ variant: "link" })}`}
target="_blank"
>
Download
</a>
</TooltipTrigger>
<TooltipContent>
<p>
To download the audio file, right click and select
&quot;Save as&quot;.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<AlertDialog>
<AlertDialogTrigger>
<Button className="w-24" variant="destructive">
Expand Down

0 comments on commit 3d8c63a

Please sign in to comment.