"use client"; import dynamic from "next/dynamic"; import { Activity, AlertTriangle, Bell, BellRing, Bug, Clock, Cog, Database, Globe, Key, Loader2, RotateCw, Server, Users, } from "lucide-react"; import { Button } from "@/components/ui/button"; import { formatDateTime } from "@/lib/format"; import { useFormatters, useTranslations } from "@/lib/i18n/context"; import { StatusItem, useSystemStatus } from "./_shared"; // v1.4.16 phase B3: Recharts is ~108 KiB Brotli — defer-load the host // metrics chart so the system-status page only ships it when an admin // actually opens this view. Splitting at the wrapper boundary (instead // of per-primitive) keeps Recharts' `findAllByType` reconciliation // working — same pattern the insights page uses for the scatter chart. const HostMetricsChart = dynamic( () => import("./host-metrics-chart").then((mod) => ({ default: mod.HostMetricsChart, })), { ssr: false, loading: () => (
), }, ); export function SystemStatusSection() { const { t } = useTranslations(); const fmt = useFormatters(); const { data: status, isError, refetch, isFetching } = useSystemStatus(); return (
{t("admin.systemStatus")}
{status ? (
{status.worker.lastReminderCheck && ( )} {status.integrations.umami && ( )} {status.integrations.glitchtip && ( )} {status.integrations.webPush && ( )} {status.integrations.bugReport && ( )}
) : isError ? ( // P19: surface load failures inline instead of leaving the // section spinning forever. The hook throws on non-OK // responses, so isError is true on 500s, network errors, etc. // v1.4.16 Wave-C MED — pair the alert with a Retry button so a // transient 500 (rolling deploy, DB blip) doesn't require a // full page reload to recover.
{t("admin.systemStatusLoadError")}
) : (
{t("admin.loadingStatus")}
)}
); }