mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
* feat: notifications backend & creation * feat: assign notification to backup schedule * refactor: status dot one component * chore(notification-details): remove refetchInterval
31 lines
604 B
TypeScript
31 lines
604 B
TypeScript
import { StatusDot } from "~/client/components/status-dot";
|
|
|
|
export const BackupStatusDot = ({
|
|
enabled,
|
|
hasError,
|
|
isInProgress,
|
|
}: {
|
|
enabled: boolean;
|
|
hasError?: boolean;
|
|
isInProgress?: boolean;
|
|
}) => {
|
|
let variant: "success" | "neutral" | "error" | "info";
|
|
let label: string;
|
|
|
|
if (isInProgress) {
|
|
variant = "info";
|
|
label = "Backup in progress";
|
|
} else if (hasError) {
|
|
variant = "error";
|
|
label = "Error";
|
|
} else if (enabled) {
|
|
variant = "success";
|
|
label = "Active";
|
|
} else {
|
|
variant = "neutral";
|
|
label = "Paused";
|
|
}
|
|
|
|
return <StatusDot variant={variant} label={label} />;
|
|
};
|