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

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/works',
    },
    {
      path: '/works',
      name: 'works',
      component: () => import('@/views/WorksView.vue'),
    },
    {
      path: '/works/:slug',
      name: 'case-detail',
      component: () => import('@/views/CaseDetailView.vue'),
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('@/views/BiographyView.vue'),
    },
    {
      path: '/contact',
      name: 'contact',
      component: () => import('@/views/ContactView.vue'),
    },
  ],
  scrollBehavior() {
    return { top: 0 }
  },
})

export default router
