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

const categories = {
  interagencyRequests: {
    label: 'interagencies.label',
    path: 'interagency-requests',
    scopes: scopes.interagencyRequests,
  },
};

const routes = [
  {
    children: [
      {
        component: () => import('@/components/interagency-requests/index.vue'),
        meta: {
          icon: 'sync_alt',
          label: categories.interagencyRequests.label,
          place: 'drawer',
          order: 22,
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'interagency-requests',
        path: '',
      },
      {
        component: () =>
          import(
            '@/components/interagency-requests/components/parent-interagency/index.vue'
          ),
        meta: {
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'parent-interagency-page',
        path: '/interagency-requests/:id',
      },
      {
        component: () =>
          import(
            '@/components/interagency-requests/components/child-interagency/index.vue'
          ),
        meta: {
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'child-interagency-page',
        path: '/interagency-requests/:parentId/child/:id',
      },
    ],
    component: () =>
      lazyLoadView(import('@router/interagency-requests/index.vue')),
    meta: {
      scopes: categories.interagencyRequests.scopes,
    },
    path: categories.interagencyRequests.path,
  },
];

export default routes;
