import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index')
  },
  {
    path: '/addUser',
    name: 'addUser',
    component: () => import('@/views/addUser/index')
  },
  {
    path: '/dealer',
    name: 'dealer',
    redirect: '/dealer/home',
    component: () => import('@/views/Layout.vue'),
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/dealer/home')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
