import scopes from '@utils/scopes';
import { Route } from 'vue-router/types';
import { lazyLoadView } from '@utils/lazyloadview';
import Vue from 'vue';

const categories = {
  backgroundInfo: {
    label: 'backgroundInfo.backgroundInfoTitle',
    path: 'background-info',
    scopes: scopes.backgroundInfo,
  },
};

const routes = [
  {
    children: [
      {
        component: () => import('@components/background-info/Index.vue'),
        meta: {
          icon: 'analytics',
          label: 'backgroundInfo.backgroundInfoTitle',
          place: 'drawer',
          order: 21,
          showProd: Vue.prototype.$appConfig.isDebugMode === 'true',
        },
        name: 'background-info',
        path: '',
        props: (route: Route) => {
          return {
            searchQuery: {
              status: route.query.status,
              search: route.query.search,
            },
          };
        },
      },
    ],
    component: () => lazyLoadView(import('@router/background-info/index.vue')),
    meta: { scopes: scopes.backgroundInfo },
    path: categories.backgroundInfo.path,
  },
];

export default routes;
