import { ENROLMENT as URL_PREFIX } from '@/config/url-prefix'
import { ENROL_TEMPLATE } from '@/config/template'

export default [
  {
    path: URL_PREFIX,
    component: () => import('@/app/enrolment/_global/components/templates/screens/EnrolmentHybridLayout'),
    name: 'Enrolment',
    redirect: URL_PREFIX + '/process/start',
    meta: {
      template: ENROL_TEMPLATE,
    },
    children: [
      {
        path: URL_PREFIX + '/area',
        component: () => import('./components/EnrolmentWrapper'),
        name: 'Enrolment Area',
        redirect: URL_PREFIX + '/process/start',
        props: true,
        children: [
          {
            path: URL_PREFIX + '/process/:type/:page?',
            component: () => import('./components/EnrolmentWrapper'),
            name: 'Enrolment Steps',
            props: true,
          },
          {
            path: URL_PREFIX + '/sponsor/:sponsorID?',
            component: () => import('./components/EnrolmentWrapper'),
            name: 'New Enrolment',
            props: true,
            meta: {
              dashboardMenu: {
                icon: 'sidebar-enrolment',
                displayName: 'Enrolment.Enrolment.Title',
                priority: 8,
                onDemandProps: ['sponsorID'],
              },
            },
          },
        ],
      },
    ],
  },
]
