import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import type { BackupAlert } from "../types/backups"; interface Props { alerts: BackupAlert[]; onAcknowledge: (alertId: string) => void; } function formatTimestamp(ts: number): string { return new Date(ts * 1000).toLocaleString(); } type SeverityVariant = "destructive" | "warning"; /** * Map an alert severity onto a Badge variant per design §2.3. * `critical` → destructive (chart-4); `warning` → warning (chart-3). */ function severityVariant(severity: string): SeverityVariant { return severity === "critical" ? "destructive" : "warning"; } export default function BackupAlertsTable({ alerts, onAcknowledge }: Props) { return (