snowballtools-base/packages/frontend/src/App.tsx

58 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-04-11 21:40:22 +00:00
import React from "react";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
2024-04-11 21:40:22 +00:00
import Projects from "./pages/org-slug";
import Settings from "./pages/org-slug/Settings";
import {
projectsRoutesWithSearch,
projectsRoutesWithoutSearch,
2024-04-11 21:40:22 +00:00
} from "./pages/org-slug/projects/routes";
import ProjectSearchLayout from "./layouts/ProjectSearch";
import Index from "./pages";
import Login from "./pages/Login";
import { DashboardLayout } from "./pages/org-slug/layout";
const router = createBrowserRouter([
{
2024-04-11 21:40:22 +00:00
path: ":orgSlug",
element: <DashboardLayout />,
children: [
{
element: <ProjectSearchLayout />,
children: [
{
2024-04-11 21:40:22 +00:00
path: "",
element: <Projects />,
},
{
2024-04-11 21:40:22 +00:00
path: "projects",
children: projectsRoutesWithSearch,
},
],
},
{
2024-04-11 21:40:22 +00:00
path: "settings",
element: <Settings />,
},
{
2024-04-11 21:40:22 +00:00
path: "projects",
children: projectsRoutesWithoutSearch,
},
],
},
{
2024-04-11 21:40:22 +00:00
path: "/",
element: <Index />,
},
{
2024-04-11 21:40:22 +00:00
path: "/login",
element: <Login />,
},
]);
function App() {
return <RouterProvider router={router} />;
}
export default App;