import Vue from "vue";
import Router from "vue-router";

import NotFound from "../views/404";
import Login from "../modules/login/Login";
// modules
import main from "./main";
import grading from "./grading";
import mark from "./mark";
import inspection from "./inspection";
import quality from "./quality";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "Index",
      redirect: { name: "Login" }
    },
    {
      path: "/login",
      name: "Login",
      component: Login
    },
    ...main,
    ...grading,
    ...mark,
    ...quality,
    ...inspection,
    {
      path: "*",
      name: "404",
      component: NotFound
    }
    // [lazy-loaded] route level code-splitting
    // {
    //   path: "/about",
    //   name: "about",
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () =>
    //     import(/* webpackChunkName: "about" */ "./views/About.vue")
    // }
  ]
});
