import React from 'react';
import { Route, Switch } from 'react-router-dom';
import "./index.scss";
import Loadable from 'react-loadable';
import Loading from '../../Loading';


const List = Loadable({
  loader: () => import('./List'),
  loading: Loading,
})
const Data = Loadable({
  loader: () => import('./data'),
  loading: Loading,
})
// 跨平台代码同步服务
const Reposyncer = Loadable({
  loader: () => import('./reposyncer'),
  loading: Loading,
})
function ServerIndex(props){
  return(
    <div className="panels">
      <Switch {...props}>
        <Route path="/:owner/:projectsId/service/reposyncer"
          render={
            () => (<Reposyncer {...props}/>)
          }
        ></Route>
        <Route path="/:owner/:projectsId/service/codeanalysis"
          render={
            () => (<Data {...props}/>)
          }
        ></Route>
        <Route path="/:owner/:projectsId/service"
          render={
            () => (<List {...props}/>)
          }
        ></Route>
      </Switch>
    </div>
  )
}
export default ServerIndex;