import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CandidatListComponent } from './candidat-list/candidat-list.component';
import { RouterModule, Routes } from '@angular/router';
import { CandidatSearchComponent } from './candidat-search/candidat-search.component';
import { CandidatsResolver } from 'src/app/shared/resolver/candidats.resolver';
import { CandidatDetailComponent } from './candidat-detail/candidat-detail.component';
import { CandidatDetailResolver } from 'src/app/shared/resolver/candidat-detail.resolver';


export const routes: Routes = [
  {
      path: 'candidat/candidat-list',
      component: CandidatListComponent,
      resolve: {
        Candidats: CandidatsResolver 
      },
  },
  {
    path: 'candidat/:candidatId/candidat-detail',
    component: CandidatDetailComponent,
    resolve: {
      Candidat: CandidatDetailResolver 
    },
}
];

@NgModule({
  declarations: [
    CandidatListComponent,
    CandidatSearchComponent,
    CandidatDetailComponent
  ],
  imports: [
    CommonModule,
    RouterModule.forChild(routes)
  ]
})
export class CandidatModule { }
