// @author ilex.h
import React from 'react';
import AsyncLoader from 'ray-code-split';

// import parsePlugin from './parsePlugin';

const AsyncEmptyPage = (props) => <AsyncLoader load={import('./../view/common/page/EmptyPage')} componentProps={props} />;
const AsyncLogin = (props) => <AsyncLoader load={import('./../view/login')} componentProps={props} />;
const AsyncRegionList = props => <AsyncLoader load={import('./../view/region')} componentProps={props} />;
// const AsyncUserInfo = (props) => <AsyncLoader load={import('./../view/userInfo')} componentProps={props} />;
const AsyncRootView = (props) => <AsyncLoader load={import('./../view/mainframe')} componentProps={props} />;
// const AsyncCompany = (props) => <AsyncLoader load={import('./../view/company')} componentProps={props} />;
// const AsyncDepartment = (props) => <AsyncLoader load={import('amos-security/lib/view/department')} componentProps={props} />;
// const AsyncMenu = (props) => <AsyncLoader load={import('amos-security/lib/view/menu')} componentProps={props} />;
// const AsyncRole = (props) => <AsyncLoader load={import('amos-security/lib/view/role')} componentProps={props} />;
// const AsyncSystemDic = (props) => <AsyncLoader load={import('amos-security/lib/view/systemdic')} componentProps={props} />;
// const AsyncUser = (props) => <AsyncLoader load={import('./../view/user')} componentProps={props} />;
const AsyncConfig = (props) => <AsyncLoader load={import('./../view/config')} componentProps={props} />;
const AsyncMonitor = (props) => <AsyncLoader load={import('./../view/monitor')} componentProps={props} />;
const AsyncHistoryAlarm = (props) => <AsyncLoader load={import('./../view/historyAlarm')} componentProps={props} />;
const AsyncRecentAlarm = (props) => <AsyncLoader load={import('./../view/recentAlarm')} componentProps={props} />;
const AsyncRuleDesign = (props) => <AsyncLoader load={import('./../view/ruleDesign')} componentProps={props} />;
const AsyncDeviceCustom  = (props) => <AsyncLoader load={import('./../view/deviceCustom')} componentProps={props} />;
const AsyncOnlineMonitor = (props) => <AsyncLoader load={import('./../view/onlineMonitor')} componentProps={props} />;
const AsyncAlarmManage = (props) => <AsyncLoader load={import('./../view/alarmManage')} componentProps={props} />;
const AsyncOverview = (props) => <AsyncLoader load={import('./../view/zonglan/home')} componentProps={props} />;
const AsyncDeviceInterface = (props) => <AsyncLoader load={import('./../view/deviceInterface')} componentProps={props} />;
const AsyncDeviceProtocol = (props) => <AsyncLoader load={import('./../view/deviceProtocol')} componentProps={props} />;
const AsyncDeviceManage = (props) => <AsyncLoader load={import('./../view/deviceManage')} componentProps={props} />;
const AsyncRuleManage = (props) => <AsyncLoader load={import('./../view/ruleManage')} componentProps={props} />;
const AsyncTopoManage = (props) => <AsyncLoader load={import('./../view/topoManage')} componentProps={props} />;
const AsyncKunShan = (props) => <AsyncLoader load={import('./../view/topoManage/KunShan')} componentProps={props} />;
const AsyncHistoricalData = (props) => <AsyncLoader load={import('./../view/historicalData')} componentProps={props} />;
const AsyncCreateEquipment = (props) => <AsyncLoader load={import('./../view/createEquipment')} componentProps={props} />;
const AsyncSectionStoreRoom = (props) => <AsyncLoader load={import('./../view/sectionStoreRoom')} componentProps={props} />;
const AsyncPLCManager = (props) => <AsyncLoader load={import('../view/plcManager')} componentProps={props} />;

const Routes = {
  // ...parsePlugin(),
  main: AsyncRootView,
  // company: AsyncCompany,
  // department: AsyncDepartment,
  // menu: AsyncMenu,
  // role: AsyncRole,
  // systemdic: AsyncSystemDic,
  // user: AsyncUser,
  config: AsyncConfig,
  monitor: AsyncMonitor,
  onlineMonitor: AsyncOnlineMonitor,
  deviceCustom: AsyncDeviceCustom,
  alarmManage: AsyncAlarmManage,
  deviceInterface: AsyncDeviceInterface,
  deviceProtocol: AsyncDeviceProtocol,
  deviceManage: AsyncDeviceManage,
  ruleManage: AsyncRuleManage,
  topoManage: AsyncTopoManage,
  kunshan: AsyncKunShan,
  historicalData: AsyncHistoricalData,
  historyAlarm: AsyncHistoryAlarm,
  recentAlarm: AsyncRecentAlarm,
  ruledesign: AsyncRuleDesign,
  overview: AsyncOverview,
  createEquipment: AsyncCreateEquipment,
  sectionStoreRoom: AsyncSectionStoreRoom,
  plcManager: AsyncPLCManager
};

const pageCompontent = (key) => {
  return Routes[key] || AsyncEmptyPage;
};

export {
  AsyncLogin,
  AsyncRootView,
  // AsyncUserInfo,
  AsyncOverview
  , AsyncRegionList
};

export default pageCompontent;
