import { lazy, Suspense } from "react"; import type { ReactElement } from "react"; // Lazy load route components for code splitting const Dashboard = lazy(() => import("@/pages/tenant/Dashboard")); const Roles = lazy(() => import("@/pages/tenant/Roles")); const Settings = lazy(() => import("@/pages/tenant/Settings")); const Users = lazy(() => import("@/pages/tenant/Users")); const AuditLogs = lazy(() => import("@/pages/tenant/AuditLogs")); const Modules = lazy(() => import("@/pages/tenant/Modules")); const LandingPage = lazy(() => import("@/pages/tenant/LandingPage")); const Departments = lazy(() => import("@/pages/tenant/Departments")); const Designations = lazy(() => import("@/pages/tenant/Designations")); const WorkflowDefination = lazy( () => import("@/pages/tenant/WorkflowDefination"), ); const Suppliers = lazy(() => import("@/pages/tenant/Suppliers")); const Documents = lazy(() => import("@/pages/tenant/Documents")); const CreateDocument = lazy(() => import("@/pages/tenant/CreateDocument")); const EditDocument = lazy(() => import("@/pages/tenant/EditDocument")); const ViewDocument = lazy(() => import("@/pages/tenant/ViewDocument")); const DocumentCategories = lazy( () => import("@/pages/tenant/DocumentCategories"), ); const DocumentsDueForReview = lazy( () => import("@/pages/tenant/DocumentsDueForReview"), ); const Tasks = lazy(() => import("@/pages/tenant/Tasks")); const NotificationSettings = lazy( () => import("@/pages/tenant/NotificationSettings"), ); const Notifications = lazy(() => import("@/pages/tenant/Notifications")); const NotificationTemplates = lazy( () => import("@/pages/tenant/NotificationTemplates"), ); const FilesList = lazy(() => import("@/pages/tenant/FilesList")); const FileView = lazy(() => import("@/pages/tenant/FileView")); const StorageDashboard = lazy(() => import("@/pages/tenant/StorageDashboard")); const SmtpSettings = lazy(() => import("@/pages/tenant/SmtpSettings")); const FailedEmails = lazy(() => import("@/pages/tenant/FailedEmails")); // const AIGateway = lazy(() => import("@/pages/tenant/AIGateway")); const CompletionHistory = lazy( () => import("@/pages/tenant/CompletionHistory"), ); const CompletionCreate = lazy(() => import("@/pages/tenant/CompletionCreate")); const CompletionDetail = lazy(() => import("@/pages/tenant/CompletionDetail")); const PromptManagement = lazy(() => import("@/pages/tenant/PromptManagement")); const PromptCreate = lazy(() => import("@/pages/tenant/PromptCreate")); const PromptEdit = lazy(() => import("@/pages/tenant/PromptEdit")); const PromptExecute = lazy(() => import("@/pages/tenant/PromptExecute")); const PromptExecutions = lazy(() => import("@/pages/tenant/PromptExecutions")); const PromptTestCases = lazy(() => import("@/pages/tenant/PromptTestCases")); const PromptTestCaseCreate = lazy( () => import("@/pages/tenant/PromptTestCaseCreate"), ); const TenantAIProviders = lazy( () => import("@/pages/tenant/TenantAIProviders"), ); const TenantAIProviderCreate = lazy( () => import("@/pages/tenant/TenantAIProviderCreate"), ); const TenantAIDashboard = lazy(() => import("@/pages/tenant/TenantAIDashboard")); const SecurityPolicy = lazy(() => import("@/pages/tenant/SecurityPolicy")); // Loading fallback component const RouteLoader = (): ReactElement => (