import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard, ResourceAuthGuard } from '@xdf/security';
import { CrudDetailComponent, CrudGridComponent, DirtyGuard, RecordResolver, TemplateResolver } from '@xdf/gallery';



const routes: Routes = [
  {
    path: "airport",
    component: CrudGridComponent,
    canActivate: [AuthGuard, ResourceAuthGuard ],
    resolve: {Template: TemplateResolver},
    data: {
      innerTemplate: 'none',
      program: "airport",
      breadcrumb: 'breadcrumb.airport'
    },
  },
  {
    path: 'airport/detail/:mode', component: CrudDetailComponent, 
    canActivate: [AuthGuard, ResourceAuthGuard],
    canDeactivate: [DirtyGuard],
    resolve: {record: RecordResolver},
    data: {
      program: 'airport',
      breadcrumb: 'breadcrumb.airport.detail'
    }
  }
];

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