import { PlayCircle } from '@mui/icons-material'; import { FC, useMemo, useState } from 'react'; import API_BASE_URL from '../../lib/consts/API_BASE_URL'; import periodicFetch from '../../lib/fetchers/periodicFetch'; import FlexBox from '../FlexBox'; import IconButton from '../IconButton'; import List from '../List'; import { Panel, PanelHeader } from '../Panels'; import Spinner from '../Spinner'; import { BodyText, HeaderText } from '../Text'; const ManageManifestPanel: FC = () => { const [isEditManifests, setIsEditManifests] = useState(false); const { data: manifestOverviews, isLoading: isLoadingManifestOverviews } = periodicFetch(`${API_BASE_URL}/manifest`, { refreshInterval: 60000, }); const listElement = useMemo( () => ( { setIsEditManifests((previous) => !previous); }} renderListItem={(manifestUUID, { manifestName }) => ( {manifestName} )} /> ), [isEditManifests, manifestOverviews], ); const panelContent = useMemo( () => (isLoadingManifestOverviews ? : listElement), [isLoadingManifestOverviews, listElement], ); return ( Manage manifests {panelContent} ); }; export default ManageManifestPanel;