import { ESHOP as URL_PREFIX, ESHOP_LISTING } from '@/config/url-prefix'
import { ESHOP_TEMPLATE } from '@/config/template'

export default [
  {
    path: URL_PREFIX,
    component: () => import('../_global/components/templates/CategoryListing'),
    name: 'Listing',
    redirect: ESHOP_LISTING,
    meta: {
      menuItem: false,
      requiresAuth: false,
      template: ESHOP_TEMPLATE,
      policy: {
        eshop: 'view',
      },
    },
    children: [
      {
        path: ESHOP_LISTING,
        component: () => import('./components/Home'),
        redirect: { name: 'ListingHomePaginated', params: { page: 1 } },
        name: 'ListingHome',
        meta: {
          title: 'general.dashboard.text',
          icon: 'beenhere',
          dashboardMenu: {
            displayName: 'Common.Eshop',
            priority: 7,
            icon: 'sidebar-eshop',
          },
        },
      },
      {
        path: ESHOP_LISTING + '/:page',
        component: () => import('./components/Home'),
        name: 'ListingHomePaginated',
        meta: {
          title: 'general.dashboard.text',
          icon: 'beenhere',
        },
      },
    ],
  },
]
