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

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

const routes = [
  {
    children: [
      {
        component: () => import('@components/scopes/index.vue'),
        meta: {
          icon: 'cloud',
          label: 'scopes.scopes',
          place: 'drawer',
          order: 23,
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'scopes',
        path: '',
        props: (route) => {
          return {
            searchQuery: {
              onlyMy: !!route.query.onlyMy && route.query.onlyMy !== 'false',
              search: route.query.search,
            },
          };
        },
      },
    ],
    component: () => lazyLoadView(import('@router/scopes/index.vue')),
    meta: {
      scopes: categories.scopes.scopes,
    },
    path: categories.scopes.path,
  },
];

export default routes;
