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

const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/HomeView.vue'),
  },
  {
    path: '/exercises',
    name: 'exercises',
    component: () => import('../views/ExerciseListView.vue'),
  },
  {
    path: '/exercises/new',
    name: 'exercise-new',
    component: () => import('../views/ExerciseFormView.vue'),
  },
  {
    path: '/exercises/:id',
    name: 'exercise-detail',
    component: () => import('../views/ExerciseDetailView.vue'),
  },
  {
    path: '/exercises/:id/edit',
    name: 'exercise-edit',
    component: () => import('../views/ExerciseFormView.vue'),
  },
  {
    path: '/combos',
    name: 'combos',
    component: () => import('../views/ComboListView.vue'),
  },
  {
    path: '/combos/new',
    name: 'combo-new',
    component: () => import('../views/ComboFormView.vue'),
  },
  {
    path: '/combos/:id',
    name: 'combo-detail',
    component: () => import('../views/ComboDetailView.vue'),
  },
  {
    path: '/combos/:id/edit',
    name: 'combo-edit',
    component: () => import('../views/ComboFormView.vue'),
  },
  {
    path: '/sessions',
    name: 'sessions',
    component: () => import('../views/SessionListView.vue'),
  },
  {
    path: '/sessions/new',
    name: 'session-new',
    component: () => import('../views/SessionFormView.vue'),
  },
  {
    path: '/sessions/:id',
    name: 'session-detail',
    component: () => import('../views/SessionDetailView.vue'),
  },
  {
    path: '/sessions/:id/edit',
    name: 'session-edit',
    component: () => import('../views/SessionFormView.vue'),
  },
  {
    path: '/sessions/:id/execute',
    name: 'session-execute',
    component: () => import('../views/SessionExecuteView.vue'),
  },
  {
    path: '/collections',
    name: 'collections',
    component: () => import('../views/CollectionsView.vue'),
  },
  {
    path: '/collections/new',
    name: 'collection-new',
    component: () => import('../views/CollectionFormView.vue'),
  },
  {
    path: '/collections/:id',
    name: 'collection-detail',
    component: () => import('../views/CollectionDetailView.vue'),
  },
  {
    path: '/collections/:id/edit',
    name: 'collection-edit',
    component: () => import('../views/CollectionFormView.vue'),
  },
  {
    path: '/stats',
    name: 'stats',
    component: () => import('../views/StatsView.vue'),
  },
  {
    path: '/settings',
    name: 'settings',
    component: () => import('../views/SettingsView.vue'),
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/home',
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router
