import { BrowserRouter as Router, Navigate, Route, Routes } from 'react-router-dom' import { lazy, memo, Suspense } from 'react' import locale from 'antd/lib/locale/ru_RU' import { ConfigProvider } from 'antd' import { RootPathContext } from '@asb/context' import { UserOutlet } from '@components/outlets' import SuspenseFallback from '@components/SuspenseFallback' import { getUserToken, NoAccessComponent } from '@utils' import { OpenAPI } from '@api' import '@styles/include/antd_theme.less' import '@styles/App.less' const Login = lazy(() => import('@pages/public/Login')) const Register = lazy(() => import('@pages/public/Register')) const FileDownload = lazy(() => import('@pages/FileDownload')) const AdminPanel = lazy(() => import('@pages/AdminPanel')) const Deposit = lazy(() => import('@pages/Deposit')) const Cluster = lazy(() => import('@pages/Cluster')) const Well = lazy(() => import('@pages/Well')) const Measure = lazy(() => import('@pages/Measure')) const Reports = lazy(() => import('@pages/Reports')) const WellCase = lazy(() => import('@pages/WellCase')) const Analytics = lazy(() => import('@pages/Analytics')) const Documents = lazy(() => import('@pages/Documents')) const Telemetry = lazy(() => import('@pages/Telemetry')) const WellOperations = lazy(() => import('@pages/WellOperations')) const DrillingProgram = lazy(() => import('@pages/DrillingProgram')) const Tvd = lazy(() => import('@pages/WellOperations/Tvd')) const WellDrillParams = lazy(() => import('@pages/WellOperations/WellDrillParams')) const DrillProcessFlow = lazy(() => import('@pages/WellOperations/DrillProcessFlow')) const WellSectionsStat = lazy(() => import('@pages/WellOperations/WellSectionsStat')) const WellOperationsEditorFact = lazy(() => import('@pages/WellOperations/OperationEditor/Fact')) const WellOperationsEditorPlan = lazy(() => import('@pages/WellOperations/OperationEditor/Plan')) const Archive = lazy(() => import('@pages/Telemetry/Archive')) const Messages = lazy(() => import('@pages/Telemetry/Messages')) const Operations = lazy(() => import('@pages/Telemetry/Operations')) const DashboardNNB = lazy(() => import('@pages/Telemetry/DashboardNNB')) const TelemetryView = lazy(() => import('@pages/Telemetry/TelemetryView')) const OperationTime = lazy(() => import('@pages/Telemetry/OperationTime')) const DailyReport = lazy(() => import('@pages/Reports/DailyReport')) const DiagramReport = lazy(() => import('@pages/Reports/DiagramReport')) const Statistics = lazy(() => import('@pages/Analytics/Statistics')) const WellCompositeEditor = lazy(() => import('@pages/Analytics/WellCompositeEditor')) //OpenAPI.BASE = 'http://localhost:3000' OpenAPI.TOKEN = async () => getUserToken() ?? '' OpenAPI.HEADERS = { 'Content-Type': 'application/json' } export const App = memo(() => ( }> } /> } /> {/* Public pages */} } /> } /> {/* User pages */} }> {/* Admin pages */} } /> {/* Client pages */} } /> } /> } /> }> } /> } /> }> } /> } /> } /> } /> } /> } /> } /> } /> }> } /> } /> } /> } /> }> } /> } /> } /> } /> }> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> )) export default App