import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DeltagareComponent } from './deltagare.component';

const routes: Routes = [
  {
    path: '',
    component: DeltagareComponent,
  },
  {
    path: ':deltagareId',
    data: { title: 'Deltagareinformation' },
    loadChildren: () => import('./pages/deltagare-card/deltagare-card.module').then(m => m.DeltagareCardModule),
  },
  {
    path: 'rapportera/:deltagareId',
    data: { title: 'Skapa rapport' },
    // eslint-disable-next-line max-len
    loadChildren: () => import('./pages/deltagare-report/pages/deltagare-avvikelse/deltagare-avvikelse.module').then(m => m.DeltagareAvvikelseModule),
  },
  {
    path: 'planering/:deltagareId',
    data: { title: 'Skapa gemensam planering' },
    loadChildren: () =>
      import('./pages/deltagare-report/deltagare-gemensam-planering/deltagare-gemensam-planering.module').then(
        m => m.DeltagareGemensamPlaneringModule
      ),
  },
  {
    path: 'periodisk-redovisning/:deltagareId',
    data: { title: 'Skapa periodisk redovisning' },
    loadChildren: () =>
      import('./pages/deltagare-report/pages/periodisk-redovisning/periodisk-redovisning.module').then(
        m => m.PeriodiskRedovisningModule
      ),
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class DeltagareRoutingModule { }
