import { Routes } from '@angular/router';
import { adminGuard } from '../../core/guards';

export const DEPARTMENTS_ROUTES: Routes = [
  {
    path: '',
    loadComponent: () =>
      import('./department-list/department-list.component').then((m) => m.DepartmentListComponent),
    canActivate: [adminGuard],
  },
  {
    path: 'new',
    loadComponent: () =>
      import('./department-form/department-form.component').then((m) => m.DepartmentFormComponent),
    canActivate: [adminGuard],
  },
  {
    path: ':id',
    loadComponent: () =>
      import('./department-detail/department-detail.component').then(
        (m) => m.DepartmentDetailComponent
      ),
    canActivate: [adminGuard],
  },
  {
    path: ':id/edit',
    loadComponent: () =>
      import('./department-form/department-form.component').then((m) => m.DepartmentFormComponent),
    canActivate: [adminGuard],
  },
];
