2024-04-11 21:40:22 +00:00
|
|
|
import React from "react";
|
|
|
|
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
2023-12-11 14:35:34 +00:00
|
|
|
|
2024-04-11 21:40:22 +00:00
|
|
|
import Projects from "./pages/org-slug";
|
|
|
|
import Settings from "./pages/org-slug/Settings";
|
2023-12-22 08:49:59 +00:00
|
|
|
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";
|
2023-12-11 14:35:34 +00:00
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
2024-04-11 21:40:22 +00:00
|
|
|
path: ":orgSlug",
|
2024-02-28 09:22:54 +00:00
|
|
|
element: <DashboardLayout />,
|
2023-12-22 08:49:59 +00:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
element: <ProjectSearchLayout />,
|
|
|
|
children: [
|
|
|
|
{
|
2024-04-11 21:40:22 +00:00
|
|
|
path: "",
|
2024-02-07 13:11:54 +00:00
|
|
|
element: <Projects />,
|
2023-12-22 08:49:59 +00:00
|
|
|
},
|
|
|
|
{
|
2024-04-11 21:40:22 +00:00
|
|
|
path: "projects",
|
2023-12-22 08:49:59 +00:00
|
|
|
children: projectsRoutesWithSearch,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2024-04-11 21:40:22 +00:00
|
|
|
path: "settings",
|
2023-12-22 08:49:59 +00:00
|
|
|
element: <Settings />,
|
|
|
|
},
|
|
|
|
{
|
2024-04-11 21:40:22 +00:00
|
|
|
path: "projects",
|
2023-12-22 08:49:59 +00:00
|
|
|
children: projectsRoutesWithoutSearch,
|
|
|
|
},
|
|
|
|
],
|
2023-12-11 14:35:34 +00:00
|
|
|
},
|
2024-02-07 13:11:54 +00:00
|
|
|
{
|
2024-04-11 21:40:22 +00:00
|
|
|
path: "/",
|
2024-02-07 13:11:54 +00:00
|
|
|
element: <Index />,
|
|
|
|
},
|
2024-02-22 11:56:26 +00:00
|
|
|
{
|
2024-04-11 21:40:22 +00:00
|
|
|
path: "/login",
|
2024-02-22 11:56:26 +00:00
|
|
|
element: <Login />,
|
|
|
|
},
|
2023-12-11 14:35:34 +00:00
|
|
|
]);
|
2023-12-08 05:20:55 +00:00
|
|
|
|
|
|
|
function App() {
|
2024-02-22 11:56:26 +00:00
|
|
|
return <RouterProvider router={router} />;
|
2023-12-08 05:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|