import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import ChapterView from '../views/ChapterView.vue'
import SortDemo from '../views/SortDemo.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/chapter/:id',
    name: 'Chapter',
    component: ChapterView,
    props: true
  },
  {
    path: '/sort-demo',
    name: 'SortDemo',
    component: SortDemo
  }
]

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

export default router
