import Stack from "@mui/material/Stack"; import { DetailGauge } from "@/Components/design-elements"; import { getPercentage, formatPercentageFromWhole } from "@/Utils/FormatUtils"; import prettyBytes from "pretty-bytes"; import { useTranslation } from "react-i18next"; import { useTheme } from "@mui/material"; import type { Diagnostics } from "@/Types/Diagnostics"; interface StatGaugesProps { diagnostics: Diagnostics | null; } export const StatGauges = ({ diagnostics }: StatGaugesProps) => { const theme = useTheme(); const { t } = useTranslation(); if (!diagnostics) { return null; } const heapTotalSize = getPercentage( diagnostics?.v8HeapStats?.totalHeapSizeBytes, diagnostics?.v8HeapStats?.heapSizeLimitBytes ); const heapUsedSize = getPercentage( diagnostics?.v8HeapStats?.usedHeapSizeBytes, diagnostics?.v8HeapStats?.heapSizeLimitBytes ); const actualHeapUsed = getPercentage( diagnostics?.v8HeapStats?.usedHeapSizeBytes, diagnostics?.v8HeapStats?.totalHeapSizeBytes ); return ( ); };