import { Routes } from '@angular/router';
import { appGuard } from './app.guard';
import { managerRoutes } from './pages/manager/manager.routes';

export const routes: Routes = [
  { path: '', pathMatch: 'full', redirectTo: '/login' },
  {
    path: 'login',
    loadComponent: () => import('./pages/login/login.component').then(m => m.LoginComponent),
  },
  {
    path: 'manager',
    canActivateChild: [appGuard],
    loadComponent: () => import('./pages/manager/manager.component').then(m => m.ManagerComponent),
    children: managerRoutes,
  },
  {
    path: 'error',
    loadComponent: () => import('./pages/error/error.component').then(m => m.ErrorComponent),
  },
];
