import { useEffect } from 'react'; import { Route, Routes, useParams } from 'react-router-dom'; import tw from 'twin.macro'; import ServerManageContainer from '@/components/admin/servers/ServerManageContainer'; import ServerStartupContainer from '@/components/admin/servers/ServerStartupContainer'; import AdminContentBlock from '@/components/admin/AdminContentBlock'; import Spinner from '@/components/elements/Spinner'; import FlashMessageRender from '@/components/FlashMessageRender'; import { SubNavigation, SubNavigationLink } from '@/components/admin/SubNavigation'; import ServerSettingsContainer from '@/components/admin/servers/ServerSettingsContainer'; import useFlash from '@/plugins/useFlash'; import { useServerFromRoute } from '@/api/admin/server'; import { AdjustmentsIcon, CogIcon, DatabaseIcon, FolderIcon, ShieldExclamationIcon } from '@heroicons/react/outline'; export default () => { const params = useParams<'id'>(); const { clearFlashes, clearAndAddHttpError } = useFlash(); const { data: server, error, isValidating, mutate } = useServerFromRoute(); useEffect(() => { mutate(); }, []); useEffect(() => { if (!error) clearFlashes('server'); if (error) clearAndAddHttpError({ key: 'server', error }); }, [error]); if (!server || (error && isValidating)) { return ( ); } return (

{server.name}

{server.uuid}

} /> } /> } />
); };