2026-06-29 07:55:47 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
|
|
|
import { AppShell } from '@/components/layout/AppShell';
|
|
|
|
|
import { ProtectedRoute } from './ProtectedRoute';
|
|
|
|
|
import { LoginPage } from '@/pages/Login';
|
|
|
|
|
import { PasswordResetRequestPage } from '@/pages/PasswordResetRequest';
|
|
|
|
|
import { PasswordResetConfirmPage } from '@/pages/PasswordResetConfirm';
|
|
|
|
|
import { DashboardPage } from '@/pages/Dashboard';
|
2026-06-29 11:01:39 +02:00
|
|
|
import { CompaniesListPage } from '@/pages/CompaniesList';
|
|
|
|
|
import { CompanyDetailPage } from '@/pages/CompanyDetail';
|
|
|
|
|
import { CompanyFormPage } from '@/pages/CompanyForm';
|
|
|
|
|
import { ContactsListPage } from '@/pages/ContactsList';
|
|
|
|
|
import { ContactDetailPage } from '@/pages/ContactDetail';
|
|
|
|
|
import { ContactFormPage } from '@/pages/ContactForm';
|
|
|
|
|
import { AuditLogPage } from '@/pages/AuditLog';
|
|
|
|
|
import { GlobalSearchResultsPage } from '@/pages/GlobalSearchResults';
|
2026-06-29 07:55:47 +02:00
|
|
|
import { SettingsPage } from '@/pages/Settings';
|
2026-06-29 11:01:39 +02:00
|
|
|
import { SettingsProfilePage } from '@/pages/SettingsProfile';
|
|
|
|
|
import { SettingsRolesPage } from '@/pages/SettingsRoles';
|
|
|
|
|
import { SettingsUsersPage } from '@/pages/SettingsUsers';
|
2026-06-30 11:35:08 +02:00
|
|
|
import { CalendarPage } from '@/pages/Calendar';
|
|
|
|
|
import { CalendarKanbanPage } from '@/pages/CalendarKanban';
|
2026-06-29 07:55:47 +02:00
|
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
|
{
|
|
|
|
|
path: '/login',
|
|
|
|
|
element: <LoginPage />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/password-reset',
|
|
|
|
|
element: <PasswordResetRequestPage />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/password-reset/confirm',
|
|
|
|
|
element: <PasswordResetConfirmPage />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
element: (
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell />
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
),
|
|
|
|
|
children: [
|
|
|
|
|
{ path: '/', element: <DashboardPage /> },
|
2026-06-29 11:01:39 +02:00
|
|
|
{ path: '/dashboard', element: <DashboardPage /> },
|
|
|
|
|
{ path: '/companies', element: <CompaniesListPage /> },
|
|
|
|
|
{ path: '/companies/new', element: <CompanyFormPage /> },
|
|
|
|
|
{ path: '/companies/:id', element: <CompanyDetailPage /> },
|
|
|
|
|
{ path: '/companies/:id/edit', element: <CompanyFormPage /> },
|
|
|
|
|
{ path: '/contacts', element: <ContactsListPage /> },
|
|
|
|
|
{ path: '/contacts/new', element: <ContactFormPage /> },
|
|
|
|
|
{ path: '/contacts/:id', element: <ContactDetailPage /> },
|
|
|
|
|
{ path: '/contacts/:id/edit', element: <ContactFormPage /> },
|
|
|
|
|
{ path: '/audit-log', element: <AuditLogPage /> },
|
|
|
|
|
{ path: '/search', element: <GlobalSearchResultsPage /> },
|
2026-06-30 11:35:08 +02:00
|
|
|
{ path: '/calendar', element: <CalendarPage /> },
|
|
|
|
|
{ path: '/calendar/kanban', element: <CalendarKanbanPage /> },
|
2026-06-29 11:01:39 +02:00
|
|
|
{
|
|
|
|
|
path: '/settings',
|
|
|
|
|
element: <SettingsPage />,
|
|
|
|
|
children: [
|
|
|
|
|
{ path: 'profile', element: <SettingsProfilePage /> },
|
|
|
|
|
{ path: 'roles', element: <SettingsRolesPage /> },
|
|
|
|
|
{ path: 'users', element: <SettingsUsersPage /> },
|
|
|
|
|
],
|
|
|
|
|
},
|
2026-06-29 07:55:47 +02:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
export function AppRouter() {
|
|
|
|
|
return <RouterProvider router={router} />;
|
|
|
|
|
}
|