import React from 'react'
import { withRouter, Switch, Redirect } from 'react-router-dom'
import LoadableComponent from '../../utils/LoadableComponent'
import PrivateRoute from '../PrivateRoute'

const Home = LoadableComponent(() => import('../../routes/Home/index'))  //参数一定要是函数，否则不会懒加载，只会代码拆分
// 知识图谱
const KnowledgeMap = LoadableComponent(() => import('../../routes/KnowledgeMap/index'))


@withRouter
class ContentMain extends React.Component {
  render () {
    return (
      <div style={{ padding: 16, position: 'relative' }}>
        <Switch>
          {/* <PrivateRoute exact path='/KnowledgeMap' component={KnowledgeMap} />

          <PrivateRoute exact path='/KnowledgeMap' component={KnowledgeMap} /> */}
          <Redirect exact from='/' to='/login' />
        </Switch>
      </div>
    )
  }
}

export default ContentMain