mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-17 08:35:21 +03:00
Remove activity indicator on review item download button
This commit is contained in:
parent
c79fa41be2
commit
0c07fdf04a
@ -1,7 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { toast } from "sonner";
|
||||
import ActivityIndicator from "../indicators/activity-indicator";
|
||||
import { FaDownload } from "react-icons/fa";
|
||||
import { formatUnixTimestampToDateTime } from "@/utils/dateUtil";
|
||||
import { cn } from "@/lib/utils";
|
||||
@ -19,8 +17,6 @@ export function DownloadVideoButton({
|
||||
startTime,
|
||||
className,
|
||||
}: DownloadVideoButtonProps) {
|
||||
const [isDownloading, setIsDownloading] = useState(false);
|
||||
|
||||
const formattedDate = formatUnixTimestampToDateTime(startTime, {
|
||||
strftime_fmt: "%D-%T",
|
||||
time_style: "medium",
|
||||
@ -29,7 +25,6 @@ export function DownloadVideoButton({
|
||||
const filename = `${camera}_${formattedDate}.mp4`;
|
||||
|
||||
const handleDownloadStart = () => {
|
||||
setIsDownloading(true);
|
||||
toast.success("Your review item video has started downloading.", {
|
||||
position: "top-center",
|
||||
});
|
||||
@ -39,19 +34,14 @@ export function DownloadVideoButton({
|
||||
<div className="flex justify-center">
|
||||
<Button
|
||||
asChild
|
||||
disabled={isDownloading}
|
||||
className="flex items-center gap-2"
|
||||
size="sm"
|
||||
aria-label="Download Video"
|
||||
>
|
||||
<a href={source} download={filename} onClick={handleDownloadStart}>
|
||||
{isDownloading ? (
|
||||
<ActivityIndicator className="size-4" />
|
||||
) : (
|
||||
<FaDownload
|
||||
className={cn("size-4 text-secondary-foreground", className)}
|
||||
/>
|
||||
)}
|
||||
</a>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user