import React from 'react';
import AsyncLoader from 'ray-code-split';

const AsyncEmptyPage = props => <AsyncLoader load={import('./../view/common/emptyPage/EmptyPage')} componentProps={props} />;
const AsyncRootView = props => <AsyncLoader load={import('../view/monitor')} componentProps={props} />;
// const AsyncUserInfo = props => <AsyncLoader load={import('./../view/userInfo')} componentProps={props} />;
const AsyncDuty = props => <AsyncLoader load={import('../view/monitor/duty')} componentProps={props} />;
const AsyncSituation = props => <AsyncLoader load={import('../view/biz/duty/situation')} componentProps={props} />;
const AsyncRegulate = props => <AsyncLoader load={import('../view/monitor/regulate')} componentProps={props} />;
const AsyncBills = props => <AsyncLoader load={import('../view/biz/regulate/bills')} componentProps={props} />;
const AsyncRootBizView = props => <AsyncLoader load={import('./../view/biz/index')} componentProps={props} />;
// const AsyncRegionList = props => <AsyncLoader load={import('./../view/common/region/index')} componentProps={props} />;

const Routes = {
  main: AsyncRootView,
  duty: AsyncDuty,
  situation: AsyncSituation,
  regulate: AsyncRegulate,
  bills: AsyncBills
};
export const businessRouts = [
  { path: 'situation',group: 'biz',component: AsyncSituation, childRoutes: [] },
  { path: 'bills',group: 'biz',component: AsyncBills, childRoutes: [] }
];
const pageCompontent = key => {
  return Routes[key] || AsyncEmptyPage;
};

export { AsyncRootView,  AsyncRootBizView };

export default pageCompontent;
