forked from ddrilling/asb_cloud_front
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
import { Redirect, Route, Switch } from 'react-router-dom'
|
|
import { PrivateRoute } from '../components/Private'
|
|
import { AdminLayoutPortal, LayoutPortal } from '../components/Layout'
|
|
import Deposit from './Deposit'
|
|
import Cluster from './Cluster'
|
|
import Well from './Well'
|
|
import AdminPanel from './AdminPanel'
|
|
|
|
export const Main = () => (
|
|
<Switch>
|
|
<PrivateRoute path={'/admin/:tab?'} roles={['admin']}>
|
|
<AdminLayoutPortal title={'Администраторская панель'}>
|
|
<AdminPanel />
|
|
</AdminLayoutPortal>
|
|
</PrivateRoute>
|
|
<Route path={'/deposit'}>
|
|
<LayoutPortal noSheet title='Месторождение'>
|
|
<Deposit />
|
|
</LayoutPortal>
|
|
</Route>
|
|
<Route path={'/cluster/:idClaster/:tab?'}>
|
|
<LayoutPortal title={'Анализ скважин куста'}>
|
|
<Cluster />
|
|
</LayoutPortal>
|
|
</Route>
|
|
<Route path={'/well/:idWell/:tab?'}>
|
|
<LayoutPortal>
|
|
<Well />
|
|
</LayoutPortal>
|
|
</Route>
|
|
<Route path={'/'}>
|
|
<Redirect to={{ pathname: `/deposit` }} />
|
|
</Route>
|
|
</Switch>
|
|
)
|
|
|
|
export default Main
|