import { Routes } from '@angular/router';
import { authGuard } from './core/guards/auth.guard';

export const routes: Routes = [
  {
    path: '',
    redirectTo: 'dashboard',
    pathMatch: 'full'
  },
  {
    path: 'login',
    loadComponent: () => import('./features/auth/login.component').then(m => m.LoginComponent)
  },
  {
    path: 'dashboard',
    canActivate: [authGuard],
    loadComponent: () => import('./features/dashboard/dashboard.component').then(m => m.DashboardComponent)
  },
  {
    path: 'directorio',
    canActivate: [authGuard],
    loadComponent: () => import('./features/directorio/directorio.component').then(m => m.DirectorioComponent)
  },
  {
    path: 'info-hub',
    canActivate: [authGuard],
    loadComponent: () => import('./features/info-hub/info-hub.component').then(m => m.InfoHubComponent)
  },
  {
    path: 'workflows',
    canActivate: [authGuard],
    loadComponent: () => import('./features/workflows/workflows.component').then(m => m.WorkflowsComponent)
  },
  {
    path: 'reservas',
    canActivate: [authGuard],
    children: [
      {
        path: '',
        redirectTo: 'calendario',
        pathMatch: 'full'
      },
      {
        path: 'calendario',
        loadComponent: () => import('./features/reservas/calendar-booking/calendar-booking.component').then(m => m.CalendarBookingComponent)
      },
      {
        path: 'nuevo',
        loadComponent: () => import('./features/reservas/reserva-form/reserva-form.component').then(m => m.ReservaFormComponent)
      }
    ]
  }
];
// Modules for each subagent will be lazily loaded here.
