import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

import AdminMain from '../views/admin/Main.vue'
import Dashboard from '../views/admin/main/Dashboard.vue'
import Create from '../views/admin/main/Create.vue'

import User from '../views/user/User.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/admin',
    component: AdminMain,
    children: [
      {
        path: '/',
        name:'Dashboard',
        component: Dashboard,
      },        
      {
        path: '/create',
        name:'Create',
        component: Create
      },     
    ]
  },

  {
    path: '/user',
    name: 'User',
    component: User
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
