import React from "react"; import { Clock, Activity } from "lucide-react"; import { useTranslation } from "react-i18next"; import type { ServerMetrics } from "@/ui/main-axios.ts"; 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 (

{t("serverStats.uptime")}

{uptime?.formatted || "N/A"}
{t("serverStats.totalUptime")}
{uptime?.seconds && (
{Math.floor(uptime.seconds).toLocaleString()}{" "} {t("serverStats.seconds")}
)}
); }