import scopes from '@utils/scopes';
import { lazyLoadView } from '@utils/lazyloadview';
import Vue from 'vue';

const categories = {
  resources: {
    label: 'resources.resourcesManagement',
    path: 'resources',
    scopes: scopes.resources,
  },
};

const routes = [
  {
    children: [
      {
        component: () => import('@components/resources/index.vue'),
        meta: {
          //   icon: 'o_domain',
          //   label: 'resources.resources',
          //   place: 'drawer',
          //   order: 5,
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'resources',
        path: '',
      },
      {
        component: () => import('@components/resources/create/index.vue'),
        meta: {
          caption: 'resources.resourcesManagement',
          // Флаг, который позволяет сделать редирект на степпер, если придёт соответствующий пуш
          hasRedirectToStepper: true,
          icon: 'create',
          label: 'resources.create',
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'resources-create',
        path: 'create',
      },
      {
        component: () => import('@components/resources/card/index.vue'),
        meta: {
          caption: 'resources.resourcesManagement',
          icon: 'work',
          label: 'resources.resourcesCard',
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'resources-card',
        path: ':id',
      },
    ],
    component: () => lazyLoadView(import('@router/resources/index.vue')),
    meta: {
      scopes: categories.resources.scopes,
    },
    path: categories.resources.path,
  },
];

export default routes;
