2023-12-08 05:20:55 +00:00
|
|
|
import React from 'react';
|
2023-12-11 14:35:34 +00:00
|
|
|
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
|
|
|
2024-02-07 13:11:54 +00:00
|
|
|
import OrgSlug from './pages/OrgSlug';
|
|
|
|
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-02-07 13:11:54 +00:00
|
|
|
} from './pages/org-slug/projects/routes';
|
2023-12-22 08:49:59 +00:00
|
|
|
import ProjectSearchLayout from './layouts/ProjectSearch';
|
2024-02-07 13:11:54 +00:00
|
|
|
import Index from './pages';
|
2024-02-22 11:56:26 +00:00
|
|
|
import Login from './pages/Login';
|
2023-12-11 14:35:34 +00:00
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
2024-02-07 13:11:54 +00:00
|
|
|
path: ':orgSlug',
|
|
|
|
element: <OrgSlug />,
|
2023-12-22 08:49:59 +00:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
element: <ProjectSearchLayout />,
|
|
|
|
children: [
|
|
|
|
{
|
2024-02-07 13:11:54 +00:00
|
|
|
path: '',
|
|
|
|
element: <Projects />,
|
2023-12-22 08:49:59 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'projects',
|
|
|
|
children: projectsRoutesWithSearch,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'settings',
|
|
|
|
element: <Settings />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'projects',
|
|
|
|
children: projectsRoutesWithoutSearch,
|
|
|
|
},
|
|
|
|
],
|
2023-12-11 14:35:34 +00:00
|
|
|
},
|
2024-02-07 13:11:54 +00:00
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
element: <Index />,
|
|
|
|
},
|
2024-02-22 11:56:26 +00:00
|
|
|
{
|
|
|
|
path: '/login',
|
|
|
|
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;
|