import { lazy, Suspense } from 'react'; import { createBrowserRouter, Navigate, RouterProvider } from 'react-router-dom'; import { routePaths } from '../hooks/useRoutes'; const Workspaces = lazy(() => import('./Workspaces')); const Workspace = lazy(() => import('./Workspace')); const RouteError = lazy(() => import('./RouteError')); const router = createBrowserRouter([ { path: '/', errorElement: , children: [ { path: '/', element: , }, { path: routePaths.workspaces(), element: , }, { path: routePaths.workspace({ workspaceId: ':workspaceId' }), element: , }, { path: routePaths.request({ workspaceId: ':workspaceId', requestId: ':requestId', }), element: , }, ], }, ]); export function AppRouter() { return ( ); }