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