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

const categories = {
  criteriaDirectory: {
    label: 'criteriaDirectory.label',
    path: 'criteria-directory',
    scopes: scopes.criteriaDirectory,
  },
};

const routes = [
  {
    children: [
      {
        component: () => import('@components/criteria-directory/index.vue'),
        meta: {
          icon: 'fact_check',
          label: categories.criteriaDirectory.label,
          place: 'drawer',
          order: 4,
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'criteria-directory',
        path: '',
      },
      {
        component: () =>
          import(
            '@components/criteria-directory/create_criteria_directoria.vue'
          ),
        meta: {
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'create_criteria_directoria',
        path: 'create',
      },
      {
        component: () =>
          import(
            '@components/criteria-directory/delete_criteria_directoria.vue'
          ),
        meta: {
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'delete_criteria_directoria',
        path: 'delete/:id',
      },
      {
        component: () =>
          import('@components/criteria-directory/edit_criteria_directoria.vue'),
        meta: {
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'edit_criteria_directoria',
        path: 'edit/:id',
      },
      {
        component: () =>
          import('@components/criteria-directory/read_criteria_directoria.vue'),
        meta: {
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'read_criteria_directoria',
        path: 'card/:id',
      },
    ],
    component: () =>
      lazyLoadView(import('@router/criteria-directory/index.vue')),
    meta: {
      scopes: categories.criteriaDirectory.scopes,
    },
    path: categories.criteriaDirectory.path,
  },
];

export default routes;
