import BasicLayout from '../layouts/BasicLayout';
import UserLayout from '../layouts/UserLayout';
import BootPage from '../pages/bootpage';
// import BootPage from '../pages/transitionalpage';
import NotFound from '../pages/exception/404';
import ServiceFail from '../pages/exception/500';
import Login from '../pages/user/login';

export const dyRoutes = routes => {
  // eslint-disable-next-line no-shadow
  const dyRoutes = routes;
  return {
    routes: [
      {
        path: '/user',
        component: UserLayout,
        routes: [
          {
            name: 'login',
            path: '/user/login',
            component: Login,
          },
        ],
      },
      {
        path: '/industry',
        component: BootPage,
      },
      {
        path: '/',
        component: BasicLayout,
        routes: [
          ...dyRoutes,
          {
            path: '/404',
            component: NotFound,
          },
          {
            path: '/500',
            component: ServiceFail,
          },
        ],
      },
      {
        path: '/404',
        component: NotFound,
      },
      {
        path: '/500',
        component: ServiceFail,
      },
    ],
  };
};
