import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'

import HomeIcon from '@/assets/icons/HomeIcon.vue'
import IdCardIcon from '@/assets/icons/IdCardIcon.vue'
import PaletteIcon from '@/assets/icons/PaletteIcon.vue'
import BriefcaseIcon from '@/assets/icons/BriefcaseIcon.vue'
import CircleInfoIcon from '@/assets/icons/CircleInfoIcon.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  scrollBehavior: () => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({ top: 0 })
      }, 500)
    })
  },
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      meta: {
        title: 'nav.home',
        icon: HomeIcon
      }
    },
    {
      path: '/general',
      name: 'general',
      component: () => import('@/views/GeneralView.vue'),
      meta: {
        title: 'nav.general',
        icon: IdCardIcon
      }
    },
    {
      path: '/anatomy',
      name: 'anatomy',
      component: () => import('@/views/AnatomyView.vue'),
      meta: {
        title: 'nav.anatomy',
        icon: PaletteIcon
      }
    },
    {
      path: '/career-path',
      name: 'career-path',
      component: () => import('@/views/CareerPathView.vue'),
      meta: {
        title: 'nav.careerPath',
        icon: BriefcaseIcon
      }
    },
    {
      path: '/attributions',
      name: 'attributions',
      component: () => import('@/views/AttributionsView.vue'),
      meta: {
        title: 'nav.attributions',
        icon: CircleInfoIcon
      }
    }
  ]
})

export default router
