Files
zerobyte/app/client/modules/backups/components/backup-status-dot.tsx
Nico 429b69ec92 fix: show back warnings logs and surface in UI (#677)
fix: show back warnings logs and surface in UI

#544

chore: fix dev login issue
2026-03-18 20:21:14 +01:00

36 lines
722 B
TypeScript

import { StatusDot } from "~/client/components/status-dot";
export const BackupStatusDot = ({
enabled,
hasError,
hasWarning,
isInProgress,
}: {
enabled: boolean;
hasError?: boolean;
hasWarning?: boolean;
isInProgress?: boolean;
}) => {
let variant: "success" | "neutral" | "error" | "warning" | "info";
let label: string;
if (isInProgress) {
variant = "info";
label = "Backup in progress";
} else if (hasError) {
variant = "error";
label = "Error";
} else if (hasWarning) {
variant = "warning";
label = "Warning";
} else if (enabled) {
variant = "success";
label = "Active";
} else {
variant = "neutral";
label = "Paused";
}
return <StatusDot variant={variant} label={label} />;
};