import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule, Routes } from "@angular/router";
import { AeropuertoListComponent } from "./view/aeropuerto-list/aeropuerto-list.component";
import { AuthGuard, ResourceAuthGuard } from "@xdf/security";
import { CrudGridComponent, TemplateResolver, CrudDetailComponent, DirtyGuard, RecordResolver } from '@xdf/gallery';
import { Template } from "@angular/compiler/src/render3/r3_ast";

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 AeropuertoRoutingModule {}
