import type { RouteRecordRaw } from 'vue-router';

// 微前端路由
const moduleName = 'micro';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/micro',
    name: moduleName,
    meta: {
      title: '微应用容器',
      icon: 'ant-design:appstore-outlined',
    },
    children: [
      {
        path: 'designer',
        name: `${moduleName}-designer`,
        meta: {
          title: '低代码编辑器',
          icon: 'ant-design:edit-outlined',
          app: {
            url: 'https://localhost:10011/__vtj__/',
            name: 'low-code-designer',
            sync: true,
            alive: true,
            degrade: true,
          },
        },
        component: () => import('@/components/micro-container/index.vue'),
      },
      {
        path: 'renderer',
        name: `${moduleName}-renderer`,
        meta: {
          title: '低代码渲染器',
          keepAlive: true,
          // hideInMenu: true,
          icon: 'ant-design:eye-outlined',
          app: {
            url: 'https://localhost:10010',
            name: 'low-code-renderer',
            // sync: true,
            // alive: true,
            // degrade: true,
          },
        },
        component: () => import('@/components/micro-container/index.vue'),
      },
      {
        path: 'y-code-v1',
        name: `${moduleName}-y-code-v1`,
        meta: {
          title: '悦码 1.0',
          // keepAlive: true,
          // hideInMenu: true,
          icon: 'ant-design:delete-outlined',
          app: {
            url: 'http://localhost:10012',
            name: 'y-code-v1',
            // sync: true,
            // alive: true,
            // degrade: true,
          },
        },
        component: () => import('@/components/micro-container/index.vue'),
      },
    ],
  },
];

export default routes;
