mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-20 16:43:53 +01:00
32 lines
695 B
TypeScript
32 lines
695 B
TypeScript
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
import { Workspaces } from '../pages/Workspaces';
|
|
import { Workspace } from '../pages/Workspace';
|
|
import { RouteError } from "./RouteError";
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: '/',
|
|
errorElement: <RouteError />,
|
|
children: [
|
|
{
|
|
path: '/',
|
|
element: <Workspaces />,
|
|
},
|
|
{
|
|
path: '/workspaces/:workspaceId',
|
|
element: <Workspace />,
|
|
},
|
|
{
|
|
path: '/workspaces/:workspaceId/requests/:requestId',
|
|
element: <Workspace />,
|
|
},
|
|
],
|
|
},
|
|
]);
|
|
|
|
export function AppRouter() {
|
|
return (
|
|
<RouterProvider router={router} />
|
|
);
|
|
}
|