2022-02-07 14:58:38 +05:00
|
|
|
import { memo } from 'react'
|
|
|
|
import { Route, Switch } from 'react-router-dom'
|
|
|
|
|
|
|
|
import { AdminLayoutPortal, LayoutPortal } from '@components/Layout'
|
|
|
|
import { PrivateDefaultRoute, PrivateRoute } from '@components/Private'
|
|
|
|
|
2021-12-02 15:21:10 +05:00
|
|
|
import Well from './Well'
|
2022-02-07 14:58:38 +05:00
|
|
|
import Cluster from './Cluster'
|
|
|
|
import Deposit from './Deposit'
|
2021-12-02 15:21:10 +05:00
|
|
|
import AdminPanel from './AdminPanel'
|
2022-02-07 14:58:38 +05:00
|
|
|
import AccessDenied from './AccessDenied'
|
2021-04-02 17:22:34 +05:00
|
|
|
|
2022-02-07 14:58:38 +05:00
|
|
|
export const Main = memo(() => (
|
2021-08-27 14:21:48 +05:00
|
|
|
<Switch>
|
2022-02-07 14:58:38 +05:00
|
|
|
<PrivateRoute path={'/admin/:tab?'}>
|
2021-12-02 15:21:10 +05:00
|
|
|
<AdminLayoutPortal title={'Администраторская панель'}>
|
|
|
|
<AdminPanel />
|
|
|
|
</AdminLayoutPortal>
|
|
|
|
</PrivateRoute>
|
2022-02-07 14:58:38 +05:00
|
|
|
<PrivateRoute path={'/deposit'}>
|
2021-12-02 15:21:10 +05:00
|
|
|
<LayoutPortal noSheet title='Месторождение'>
|
|
|
|
<Deposit />
|
|
|
|
</LayoutPortal>
|
2022-02-07 14:58:38 +05:00
|
|
|
</PrivateRoute>
|
|
|
|
<PrivateRoute path={'/cluster/:idCluster'}>
|
2021-12-02 15:21:10 +05:00
|
|
|
<LayoutPortal title={'Анализ скважин куста'}>
|
|
|
|
<Cluster />
|
|
|
|
</LayoutPortal>
|
2022-02-07 14:58:38 +05:00
|
|
|
</PrivateRoute>
|
|
|
|
<PrivateRoute path={'/well/:idWell/:tab?'}>
|
2021-12-02 15:21:10 +05:00
|
|
|
<LayoutPortal>
|
|
|
|
<Well />
|
|
|
|
</LayoutPortal>
|
2022-02-07 14:58:38 +05:00
|
|
|
</PrivateRoute>
|
|
|
|
<Route path={'/access_denied'}>
|
|
|
|
<AccessDenied />
|
2021-12-02 15:21:10 +05:00
|
|
|
</Route>
|
2022-02-07 14:58:38 +05:00
|
|
|
<PrivateDefaultRoute urls={['/deposit']} />
|
2021-08-27 14:21:48 +05:00
|
|
|
</Switch>
|
2022-02-07 14:58:38 +05:00
|
|
|
))
|
2021-12-02 15:21:10 +05:00
|
|
|
|
|
|
|
export default Main
|