import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

import AppLayout from './layouts/AppLayout.vue';
import EmployerLayout from './layouts/EmployerLayout.vue';

import Home from './views/Home.vue';
import Account from './views/Account.vue';
import Login from './views/Login.vue';
import Register from './views/Register.vue'
import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue';
import Addjob from './views/Addjob.vue';
import RegisterEmployer from './views/RegisterEmployer';

export default new VueRouter({
  mode: 'history',
  routes: [
    {
      path: '/employer',
      name: 'employerLayout',
      component: EmployerLayout,
      children: [
        {
          path: 'login',
          name: 'loginEmployer',
          component: LoginEmployer
        },
        {
          path: 'register',
          name: 'registerEmployer',
          component: RegisterEmployer
        },
        {
          path: 'addjob',
          name: 'addjob',
          component: Addjob
        },
        {
          path: '*',
          name: '404Employer',
          component: PageNotFound
        }
      ]
    },
    {
      path: '/',
      name: 'appLayout',
      component: AppLayout,
      children: [
        {
          path: '',
          name: 'Home',
          component: Home
        },
        {
          path: 'account',
          name: 'account',
          component: Account
        },
        {
          path: '*',
          name: 'pageNotFound',
          component: PageNotFound
        }
      ]
    }
  ]
})