2022-10-25 13:35:38 -05:00
|
|
|
import { useTranslation } from "next-i18next";
|
2023-06-03 01:10:15 +01:00
|
|
|
import { FaThermometerHalf } from "react-icons/fa";
|
2022-10-25 13:35:38 -05:00
|
|
|
|
2023-06-05 23:18:18 +01:00
|
|
|
import Resource from "../widget/resource";
|
2023-06-03 01:10:15 +01:00
|
|
|
import WidgetLabel from "../widget/widget_label";
|
2022-10-25 13:35:38 -05:00
|
|
|
|
|
|
|
export default function Node({ data, expanded, labels }) {
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
2023-06-05 23:18:18 +01:00
|
|
|
return <Resource
|
|
|
|
icon={FaThermometerHalf}
|
|
|
|
value={t("common.bytes", { value: data.node.available })}
|
|
|
|
label={t("resources.free")}
|
|
|
|
expandedValue={t("common.bytes", { value: data.node.maximum })}
|
|
|
|
expandedLabel={t("resources.total")}
|
|
|
|
percentage={Math.round(((data.node.maximum - data.node.available) / data.node.maximum) * 100)}
|
|
|
|
expanded={expanded}
|
|
|
|
>{ labels && <WidgetLabel label={data.node.id} /> }
|
|
|
|
</Resource>
|
2022-10-25 13:35:38 -05:00
|
|
|
}
|