Back to React

This commit is contained in:
Gregory Schier
2023-03-13 09:50:49 -07:00
parent fa1f33a2ac
commit c6653af782
25 changed files with 377 additions and 616 deletions

View File

@@ -1,13 +1,31 @@
import { Router } from 'preact-router';
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 (
<Router>
<Workspaces path="/" />
<Workspace path="/workspaces/:workspaceId" />
<Workspace path="/workspaces/:workspaceId/requests/:requestId" />
</Router>
<RouterProvider router={router} />
);
}