feat: backup in progress status

This commit is contained in:
Nicolas Meienberger
2025-11-08 10:33:08 +01:00
parent 42497be4b5
commit ba08c97681
8 changed files with 43 additions and 13 deletions

View File

@@ -1,11 +1,17 @@
import { cn } from "~/lib/utils";
import { Tooltip, TooltipContent, TooltipTrigger } from "~/components/ui/tooltip";
type BackupStatus = "active" | "paused" | "error";
type BackupStatus = "active" | "paused" | "error" | "in_progress";
export const BackupStatusDot = ({ enabled, hasError }: { enabled: boolean; hasError?: boolean }) => {
export const BackupStatusDot = ({
enabled,
hasError,
isInProgress,
}: { enabled: boolean; hasError?: boolean; isInProgress?: boolean }) => {
let status: BackupStatus = "paused";
if (hasError) {
if (isInProgress) {
status = "in_progress";
} else if (hasError) {
status = "error";
} else if (enabled) {
status = "active";
@@ -30,6 +36,12 @@ export const BackupStatusDot = ({ enabled, hasError }: { enabled: boolean; hasEr
animated: true,
label: "Error",
},
in_progress: {
color: "bg-blue-500",
colorLight: "bg-blue-400",
animated: true,
label: "Backup in progress",
},
}[status];
return (