import { useEggFromRoute } from '@/api/admin/egg'; import EggInstallContainer from '@/components/admin/nests/eggs/EggInstallContainer'; import EggVariablesContainer from '@/components/admin/nests/eggs/EggVariablesContainer'; import useFlash from '@/plugins/useFlash'; import React, { useEffect } from 'react'; import { useLocation } from 'react-router'; import tw from 'twin.macro'; import { Route, Switch, useRouteMatch } from 'react-router-dom'; 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 EggSettingsContainer from '@/components/admin/nests/eggs/EggSettingsContainer'; const EggRouter = () => { const location = useLocation(); const match = useRouteMatch(); const { clearFlashes, clearAndAddHttpError } = useFlash(); const { data: egg, error, isValidating, mutate } = useEggFromRoute(); useEffect(() => { mutate(); }, []); useEffect(() => { if (!error) clearFlashes('egg'); if (error) clearAndAddHttpError({ key: 'egg', error }); }, [ error ]); if (!egg || (error && isValidating)) { return ( ); } return (

{egg.name}

{egg.uuid}

); }; export default () => { return ; };