import { ShieldCheck } from "lucide-react"; import { useTranslation } from "react-i18next"; import type { ServerMetrics } from "@/main-axios"; import { MetricCard } from "@/components/metric-card"; export function FirewallCard({ metrics }: { metrics: ServerMetrics | null }) { const { t } = useTranslation(); const fw = metrics?.firewall; const totalRules = fw?.chains?.reduce((sum, c) => sum + (c.rules?.length ?? 0), 0) ?? 0; return ( } > {!fw || fw.type === "none" ? ( {t("hostMetrics.firewall.noData")} ) : (
{fw.status === "inactive" ? t("hostMetrics.firewall.inactive") : fw.status} {fw.type}
{fw.chains?.length ?? 0} {" "} {t("hostMetrics.firewall.chains")} {totalRules}{" "} {t("hostMetrics.firewall.rules")}
)}
); }