import { Suspense } from 'react'; import { NavLink, Route, Routes, useLocation } from 'react-router-dom'; import NavigationBar from '@/components/NavigationBar'; import DashboardContainer from '@/components/dashboard/DashboardContainer'; import { NotFound } from '@/components/elements/ScreenBlock'; import Spinner from '@/components/elements/Spinner'; import SubNavigation from '@/components/elements/SubNavigation'; import routes from '@/routers/routes'; function DashboardRouter() { const location = useLocation(); return ( <> {location.pathname.startsWith('/account') && ( {routes.account .filter(route => route.path !== undefined) .map(({ path, name, end = false }) => ( {name} ))} )} }> } /> {routes.account.map(({ route, component: Component }) => ( } /> ))} } /> > ); } export default DashboardRouter;