import { Cpu } from "lucide-react"; import { useTranslation } from "react-i18next"; import type { ServerMetrics } from "@/main-axios"; import { StatRow } from "@/components/charts"; import { MetricCard } from "./MetricCard"; export function ProcessesCard({ metrics }: { metrics: ServerMetrics | null }) { const { t } = useTranslation(); const procs = metrics?.processes; const top = procs?.top ?? []; return ( } scroll >
{procs?.total != null && ( {procs.total}{" "} {t("hostMetrics.processesTotal")} )} {procs?.running != null && ( {procs.running}{" "} {t("hostMetrics.processesRunning")} )}
{top.length === 0 ? ( {t("hostMetrics.noProcessesFound")} ) : (
{top.slice(0, 10).map((p) => ( ))}
)}
); }