import { createRouter, createMemoryHistory , createWebHashHistory} from 'vue-router'

const routes = [
  // Chat principal y config
  { path: '/',          name: 'chat',      component: () => import('@/views/ChatView.vue') },
  { path: '/config',     name: 'settings',  component: () => import('@/views/SettingsView.vue') },

  // ────── Empleados ──────
  { path: '/empleados',           name: 'empleados-index', component: () => import('@/views/empleados/EmpleadosIndex.vue') },
  { path: '/empleados/nuevo',     name: 'empleados-new',   component: () => import('@/views/empleados/EmpleadoForm.vue') },
  { path: '/empleados/:id',       name: 'empleados-edit',  component: () => import('@/views/empleados/EmpleadoForm.vue'),  props: true },

  // ────── Tareas ──────
  { path: '/tareas',              name: 'tareas-index',    component: () => import('@/views/tareas/TareasIndex.vue') },
  { path: '/tareas/nuevo',        name: 'tareas-new',      component: () => import('@/views/tareas/TareaForm.vue') },
  { path: '/tareas/:id',          name: 'tareas-edit',     component: () => import('@/views/tareas/TareaForm.vue'),       props: true },

  // ────── Planillas ──────
  { path: '/planillas',           name: 'planillas-index', component: () => import('@/views/planillas/PlanillasIndex.vue') },
  { path: '/planillas/nuevo',     name: 'planillas-new',   component: () => import('@/views/planillas/PlanillaForm.vue') },
  { path: '/planillas/:id',       name: 'planillas-edit',  component: () => import('@/views/planillas/PlanillaForm.vue'),  props: true },

  // ────── Asistencias ──────
  { path: '/asistencias',         name: 'asistencias-index', component: () => import('@/views/asistencias/AsistenciasIndex.vue') },
  { path: '/asistencias/nuevo',   name: 'asistencias-new',   component: () => import('@/views/asistencias/AsistenciaForm.vue') },
  { path: '/asistencias/:id',     name: 'asistencias-edit',  component: () => import('@/views/asistencias/AsistenciaForm.vue'), props: true },

  // 404
  { path: '/:pathMatch(.*)*', name: 'not-found', component: () => import('@/views/NotFound.vue') }
]

export default createRouter({
  history: createWebHashHistory(),
  routes,
})