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

const categories = {
  statementDrafts: {
    label: 'statementDrafts.label',
    path: 'statement-drafts',
    scopes: scopes.statementDrafts,
  },
};

const routes = [
  {
    children: [
      {
        component: () => import('@components/statement-drafts/index.vue'),
        meta: {
          icon: 'edit',
          label: categories.statementDrafts.label,
          place: 'drawer',
          order: 121,
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'statementDrafts',
        path: '',
        props: (route) => {
          return {
            searchQuery: {
              onlyMy: !(route.query.onlyMy === 'false'),
              status: route.query.status,
              daterange: route.query.daterange,
              employees: route.query.employees,
              organizations: route.query.organizations,
              search: route.query.search,
              services: route.query.services,
              goals: route.query.goals,
            },
          };
        },
      },
    ],
    component: () => lazyLoadView(import('@router/statement-drafts/index.vue')),
    meta: {
      scopes: categories.statementDrafts.scopes,
    },
    path: categories.statementDrafts.path,
  },
];

export default routes;
