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-07-03 15:23:58 +00:00
|
|
|
import { SettingsPluginsPage } from '@/pages/SettingsPlugins';
|
2026-07-04 00:27:20 +00:00
|
|
|
import { SettingsSystemPage } from '@/pages/SettingsSystem';
|
2026-07-04 01:37:04 +00:00
|
|
|
import { SettingsCurrenciesPage } from '@/pages/SettingsCurrencies';
|
|
|
|
|
import { SettingsTaxesPage } from '@/pages/SettingsTaxes';
|
|
|
|
|
import { SettingsSequencesPage } from '@/pages/SettingsSequences';
|
2026-06-30 11:35:08 +02:00
|
|
|
import { CalendarPage } from '@/pages/Calendar';
|
|
|
|
|
import { CalendarKanbanPage } from '@/pages/CalendarKanban';
|
2026-07-01 16:54:32 +02:00
|
|
|
import { DmsPage } from '@/pages/Dms';
|
|
|
|
|
import { DmsTrashPage } from '@/pages/DmsTrash';
|
2026-07-01 20:43:49 +02:00
|
|
|
import { MailPage } from '@/pages/Mail';
|
|
|
|
|
import { MailSettingsPage } from '@/pages/MailSettings';
|
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-07-01 16:54:32 +02:00
|
|
|
{ path: '/dms', element: <DmsPage /> },
|
|
|
|
|
{ path: '/dms/trash', element: <DmsTrashPage /> },
|
2026-07-01 20:43:49 +02:00
|
|
|
{ path: '/mail', element: <MailPage /> },
|
|
|
|
|
{ path: '/mail/settings', element: <MailSettingsPage /> },
|
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-07-03 15:23:58 +00:00
|
|
|
{ path: 'plugins', element: <SettingsPluginsPage /> },
|
2026-07-04 00:27:20 +00:00
|
|
|
{ path: 'system', element: <SettingsSystemPage /> },
|
2026-07-04 01:37:04 +00:00
|
|
|
{ path: 'currencies', element: <SettingsCurrenciesPage /> },
|
|
|
|
|
{ path: 'taxes', element: <SettingsTaxesPage /> },
|
|
|
|
|
{ path: 'sequences', element: <SettingsSequencesPage /> },
|
2026-06-29 11:01:39 +02:00
|
|
|
],
|
|
|
|
|
},
|
2026-06-29 07:55:47 +02:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
export function AppRouter() {
|
|
|
|
|
return <RouterProvider router={router} />;
|
|
|
|
|
}
|