import React from 'react'
import { Layout } from 'antd'
import { Route, Switch } from 'dva/router'
import Navigator from '../components/common/navigator'
import Welcome from '../components/myPage/welcome'
import Loading from '../components/common/loading'
import DataSource from '../components/datasource/dataSource'
import DataSourceDetail from '../components/datasource/dataSourceDetail'
// import Dashboard from '../components/dashboard/dashboard'
import Chart from '../components/chart/list'
import './mainLayout.less';
import Demo from '../demo';
const { Header, Content } = Layout

const MainLayout = (history) => {
    return(
        <Layout className='main-layout'>
            <Loading />
            <Header className='main-header'>
                <Navigator />
            </Header>
            <Content className='main-content'>
                <Switch>
                    <Route exact path='/demo' component={Demo}/>
                    <Route exact path='/' component={Welcome}/>
                    <Route exact path='/home' component={Welcome}/>
                    <Route exact sensitive path='/datasource' component={DataSource}/>
                    <Route sensitive path='/datasource/:type/:code/:tab' component={DataSourceDetail}/>
                    {/* <Route exact sensitive path='/dashboard' component={Dashboard} /> */}
                    <Route exact sensitive path='/chart' component={Chart} />
                </Switch>
            </Content>
        </Layout>
    )
}
export default MainLayout;