import { NgModule } from '@angular/core';
import { Router, RouterModule, Routes } from '@angular/router';
import { CrudDetailComponent, CrudGridComponent, TemplateResolver } from '@xdf/gallery';
import { AuthGuard, ResourceAuthGuard } from '@xdf/security';
import { AgentDetailComponent } from './view/agent-detail/agent-detail.component';
import { FlightConfigComponent } from './view/flight-config/flight-config.component';

const routes: Routes = [
    {
        path: 'agents',
        component: CrudGridComponent,
        canActivate: [AuthGuard, ResourceAuthGuard],
        resolve: { template:  TemplateResolver },
        data: {
            innerTemplate: 'none',
            program: 'agent_list',
            breadcrumb: 'Agentes'
        }
    },
    {
        path: 'agents/detail/:mode',
        component: AgentDetailComponent,
        canActivate: [AuthGuard, ResourceAuthGuard],
        data: {
            innerTemplate: 'none',
            program: 'agent_detail',
            breadcrumb: 'Agentes'
        }
    },
    {
        path: 'flights',
        component: CrudGridComponent,
        canActivate: [AuthGuard, ResourceAuthGuard],
        resolve: { template:  TemplateResolver },
        data: {
            innerTemplate: 'none',
            program: 'supervisor_flights_list',
            breadcrumb: 'Configuración de vuelos'
        }
    },
    {
        path: 'flights/detail/:mode',
        component: FlightConfigComponent,
        canActivate: [AuthGuard, ResourceAuthGuard],
        data: {
            innerTemplate: 'none',
            program: 'supervisor_flights_list',
            breadcrumb: 'Configuración de vuelos'
        }
    }
];

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