import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    meta: { layout: 1 },
    component: () => import('@/views/Home.vue')
  },
  {
    path: '/helpCenter',
    name: 'HelpCenter',
    meta: { layout: 2 },
    component: () => import('@/views/HelpCenter.vue'),
  },
  {
    path: '/digitalAssets',
    name: 'DigitalAssets',
    meta: { layout: 4 },
    component: () => import('@/views/DigitalAssets.vue'),
  },
  {
    path: '/personalProvenance',
    name: 'PersonalProvenance',
    meta: { layout: 4 },
    component: () => import('@/views/PersonalProvenance.vue'),
  },
  {
    path: '/companyProvenance',
    name: 'CompanyProvenance',
    meta: { layout: 4 },
    component: () => import('@/views/CompanyProvenance.vue'),
  },
  {
    path: '/autoDeposits',
    name: 'AutoDeposits',
    meta: { layout: 4 },
    component: () => import('@/views/Auto.vue'),
  },
  {
    path: '/mail',
    name: 'Mail',
    meta: { layout: 4 },
    component: () => import('@/views/Mail.vue'),
  },
  {
    path: '/solutions',
    name: 'Solutions',
    meta: { layout: 3 },
    component: () => import('@/views/Solutions/index.vue'),
    redirect: { name: "FoodSafety" },
    children: [
      {
        path: 'foodSafety',
        name: 'FoodSafety',
        component: () => import('@/views/Solutions/foodSafety.vue'),
      },
      {
        path: 'healthProvenance',
        name: 'HealthProvenance',
        component: () => import('@/views/Solutions/health.vue'),
      },
      {
        path: 'publicWelfare',
        name: 'PublicWelfare',
        component: () => import('@/views/Solutions/publicWelfare.vue'),
      },
      {
        path: 'team',
        name: 'Team',
        component: () => import('@/views/Solutions/team.vue'),
      },
      {
        path: 'digitalDocument',
        name: 'DigitalDocument',
        component: () => import('@/views/Solutions/document.vue'),
      },
      {
        path: 'digitalContract',
        name: 'DigitalContract',
        component: () => import('@/views/Solutions/contract.vue'),
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
