import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Login from '@/components/Login'
import Books from '@/components/Books'
import BooksAddEdit from '@/components/BooksAddEdit'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/books',
      name: 'books',
      component: Books
    },
    {
      path: '/books/add',
      name: 'add-book',
      component: BooksAddEdit
    },
    {
      path: '/books/:id/edit',
      name: 'book-edit',
      component: BooksAddEdit
    }
  ],
  linkActiveClass: 'active'
})
