import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {MonitorComponent} from "./monitor.component";

@NgModule({
  imports: [
    RouterModule.forChild([
      { path: '', redirectTo: '/ec', pathMatch: 'full'},
      {
        path: ':stakeholder',
        component: MonitorComponent,
        canActivate: [FreeGuard],
        canDeactivate: [PreviousRouteRecorder],
        data: {hasHeader: false}
      },
      {
        path: ':stakeholder/:topic',
        component: MonitorComponent,
        canActivate: [FreeGuard],
        canDeactivate: [PreviousRouteRecorder],
        data: {hasHeader: false}
      },
      {
        path: ':stakeholder/:topic/:category',
        component: MonitorComponent,
        canActivate: [FreeGuard],
        canDeactivate: [PreviousRouteRecorder],
        data: {hasHeader: false}
      },
      {
        path: ':stakeholder/:topic/:category/:subCategory',
        component: MonitorComponent,
        canActivate: [FreeGuard],
        canDeactivate: [PreviousRouteRecorder],
        data: {hasHeader: false}
      }
    ])
  ]
})
export class MonitorRoutingModule {
}
