import { Clock } from "lucide-react"; import { useTranslation } from "react-i18next"; import type { ServerMetrics } from "@/main-axios.ts"; import { SectionCard } from "@/components/section-card"; interface UptimeWidgetProps { metrics: ServerMetrics | null; metricsHistory: ServerMetrics[]; } export function UptimeWidget({ metrics }: UptimeWidgetProps) { const { t } = useTranslation(); const metricsWithUptime = metrics as ServerMetrics & { uptime?: { formatted?: string; seconds?: number }; }; const uptime = metricsWithUptime?.uptime; return ( } >
{uptime?.formatted ?? "N/A"} {uptime?.seconds && ( {Math.floor(uptime.seconds).toLocaleString()}{" "} {t("serverStats.seconds")} )}
); }