import React from 'react'; import { createBrowserRouter } from 'react-router-dom'; import { AppShell } from '../layouts/AppShell'; import { DashboardPage, OperationsPage, CrmPage, SalesPage, InventoryPage, FinancePage, EmployeesPage, CommunicationsPage, HelpDeskPage, TasksPage, CmsPage, MarketingPage, AnalyticsPage, AutomationPage, AiPage, AppsPage, SettingsPage, EntityCatalogPage, FieldBuilderPage, FormBuilderPage, CardLayoutBuilderPage, ViewBuilderPage, CustomEntityRoutePage, ForbiddenPage, NotFoundPage, } from '../../pages'; import { ErrorBoundary } from '../../shared/ui/ErrorBoundary'; import { ControlCenterShell } from '../../features/control-center/components/ControlCenterShell'; import { ControlRouteGuard } from '../../features/control-center/components/ControlRouteGuard'; import { OverviewPage, OrganizationsPage, BillingPage, ModulesPage, InstallationsPage, InfrastructurePage, AnnouncementsPage, IncidentsPage, AuditPage, ControlForbiddenPage, ControlAccessGatePage, } from '../../features/control-center/pages'; export const router = createBrowserRouter([ { path: '/control/gate', element: , }, { path: '/control/403', element: , }, { path: '/control', element: ( ), errorElement: (
), children: [ { index: true, element: }, { path: 'organizations', element: }, { path: 'billing', element: }, { path: 'modules', element: }, { path: 'installations', element: }, { path: 'infrastructure', element: }, { path: 'announcements', element: }, { path: 'incidents', element: }, { path: 'audit', element: }, { path: '*', element: }, ], }, { path: '/', element: , errorElement: (
), children: [ { index: true, element: }, { path: 'operations/*', element: }, { path: 'crm/*', element: }, { path: 'sales/*', element: }, { path: 'inventory/*', element: }, { path: 'finance/*', element: }, { path: 'employees/*', element: }, { path: 'communications/*', element: }, { path: 'helpdesk/*', element: }, { path: 'tasks/*', element: }, { path: 'cms/*', element: }, { path: 'marketing/*', element: }, { path: 'analytics/*', element: }, { path: 'automation/*', element: }, { path: 'ai/*', element: }, { path: 'apps/*', element: }, { path: 'settings/entities', element: }, { path: 'settings/entities/:entityCode/fields', element: }, { path: 'settings/entities/:entityCode/forms', element: }, { path: 'settings/entities/:entityCode/card', element: }, { path: 'settings/entities/:entityCode/views', element: }, { path: 'settings/*', element: }, { path: 'entities/:entityCode', element: }, { path: 'entities/:entityCode/:recordId', element: }, { path: 'forbidden', element: }, { path: '403', element: }, { path: '*', element: }, ], }, ]);