asb_cloud_front/src/pages/Main.jsx

38 lines
1.2 KiB
React
Raw Normal View History

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'
2021-04-02 17:22:34 +05:00
export const Main = () => (
2021-08-27 14:21:48 +05:00
<Switch>
<PrivateRoute path={'/admin/:tab?'} permission={'admin_panel'}>
<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>
2021-08-27 14:21:48 +05:00
</Switch>
)
export default Main