import { Database } from "lucide-react"; import { useTranslation } from "@termix/plugin-sdk/frontend"; import type { ProxmoxStatsSnapshot } from "@/types/proxmox"; import { MetricCard } from "@/components/metric-card"; export function StoragePoolsCard({ snapshot, }: { snapshot: ProxmoxStatsSnapshot | null; }) { const { t } = useTranslation(); const pools = snapshot?.storage.pools ?? []; return ( } scroll > {pools.length === 0 ? ( N/A ) : (
{pools.map((pool) => (
{pool.name} {pool.type} {!pool.active && ( {t("proxmoxStats.inactive")} )}
{pool.usedGiB !== null && pool.totalGiB !== null ? `${pool.usedGiB.toFixed(1)} / ${pool.totalGiB.toFixed(1)} GiB` : "N/A"}
))}
)} ); }