import Stack from "@mui/material/Stack"; import CustomGauge from "../../../../../Components/Charts/CustomGauge"; import Typography from "@mui/material/Typography"; // Utils import { useTheme } from "@emotion/react"; import PropTypes from "prop-types"; import { getPercentage, formatBytes } from "../../utils/utils"; import { useTranslation } from "react-i18next"; import { Box } from "@mui/material"; const BaseContainer = ({children}) => { const theme = useTheme() return( {children} ); }; const InfrastructureStyleGauge = ({ value, heading, metricOne, valueOne, metricTwo, valueTwo }) => { const theme = useTheme(); const MetricRow = ({ label, value }) => ( {label} {value} ); return( {heading} {metricTwo && valueTwo && ( )} ); }; const Gauges = ({ diagnostics, isLoading }) => { 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 ); const theme = useTheme(); const { t } = useTranslation(); return ( ); }; Gauges.propTypes = { diagnostics: PropTypes.object, isLoading: PropTypes.bool, }; InfrastructureStyleGauge.propTypes = { value: PropTypes.number, heading: PropTypes.string, metricOne: PropTypes.string, valueOne: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), metricTwo: PropTypes.string, valueTwo: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), }; BaseContainer.propTypes = { children: PropTypes.node.isRequired, }; export default Gauges;