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

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('../views/HomeView.vue')
    },
    {
      path: '/destinations/:id/attends',
      name: 'destination_attends',
      component: () => import('../views/AttendingView.vue')
    },
    {
      path: '/destinations/:id',
      name: 'destination',
      component: () => import('../views/DestinationView.vue')
    },
    {
      path: '/destinations',
      name: 'destinations',
      component: () => import('../views/DestinationsView.vue')
    },
    {
      path: '/my-destinations',
      name: 'my-destinations',
      component: () => import('../views/MyDestinationsView.vue')
    },
    {
      path: '/destination/add',
      name: 'add-destinations',
      component: () => import('../views/CreateDestinationView.vue')
    },
    {
      path: '/post/add',
      name: 'add-posts',
      component: () => import('../views/CreatePostView.vue')
    },
    {
      path: '/posts/:id',
      name: 'post',
      component: () => import('../views/PostView.vue')
    },
    {
      path: '/faq',
      name: 'faq',
      component: () => import('../views/FAQView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/authentication/LoginView.vue')
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/authentication/RegisterView.vue')
    },
    {
      path: '/profile',
      name: 'profile',
      component: () => import('../views/ProfileView.vue')
    },
    {
      path: '/profile/edit',
      name: 'profile-edit',
      component: () => import('../views/ProfileEditView.vue')
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('../views/SearchView.vue')
    },
    {
      path: '/search/:searchTerm',
      name: 'search-w-term',
      component: () => import('../views/SearchView.vue')
    }
  ]
})

export default router
