import { FaMemory } from "react-icons/fa"; import { FiAlertTriangle, FiCpu, FiServer } from "react-icons/fi"; import { SiKubernetes } from "react-icons/si"; import { useTranslation } from "next-i18next"; import UsageBar from "./usage-bar"; export default function Node({ type, options, data }) { const { t } = useTranslation(); console.log("Node", type, options, data); function icon() { if (type === "cluster") { return ; } if (data.ready) { return ; } return ; } return (
{icon()}
{t("common.number", { value: data.cpu.percent, style: "unit", unit: "percent", maximumFractionDigits: 0 })}
{t("common.bytes", { value: data.memory.free, maximumFractionDigits: 0, binary: true })}
{options.showLabel && (
{type === "cluster" ? options.label : data.name}
)}
); }