import { Box } from '@mui/material'; import * as prettyBytes from 'pretty-bytes'; import { useContext } from 'react'; import { AnvilContext } from './AnvilContext'; import { AllocationBar } from './Bars'; import { Panel, PanelHeader } from './Panels'; import periodicFetch from '../lib/fetchers/periodicFetch'; import Spinner from './Spinner'; import { HeaderText, BodyText } from './Text'; const Memory = (): JSX.Element => { const { uuid } = useContext(AnvilContext); const { data: { allocated = 0, reserved = 0, total = 0 } = {}, isLoading } = periodicFetch( `${process.env.NEXT_PUBLIC_API_URL}/get_memory?anvil_uuid=${uuid}`, ); return ( {!isLoading ? ( <> ) : ( )} ); }; export default Memory;