import { useContext } from 'react'; import { Box } from '@material-ui/core'; 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'; const Memory = (): JSX.Element => { const { uuid } = useContext(AnvilContext); const { data, isLoading } = PeriodicFetch( `${process.env.NEXT_PUBLIC_API_URL}/anvils/get_memory?anvil_uuid=${uuid}`, ); const memoryData = isLoading || !data ? { total: 0, free: 0 } : data; return ( ); }; export default Memory;