/**
 * Created by Administrator on 2017/12/18 0018.消息通知
 */
import dynamic from 'dva/dynamic';

// wrapper of dynamic
const dynamicWrapper = (app, models, component) =>
  dynamic({
    app,
    models: () => models.map(m => import(`../models/${m}.js`)),
    component
  });

export const MessageNotification = app => {
  return {
    name: '消息',
    icon: 'xiaoxitongzhi',
    path: 'xiaoxitongzhi',
    children: [
      {
        name: '消息通知',
        path: 'Messages',
        component: dynamicWrapper(app, ['profile'], () =>
          import('../routes/Administrative/MessageSettings/Messages')
        )
      }
    ]
  };
};
