import { NgModule } from '@angular/core';
import { Routes } from '@angular/router';
import { NativeScriptRouterModule } from '@nativescript/angular';
import { UnitFunctionsComponent } from '~/pages/unit/containers/unit-functions/unit-functions.component';
import { UnitMembersComponent } from '~/pages/unit/containers/unit-members/unit-members.component';
import { UnitStatsComponent } from '~/pages/unit/containers/unit-stats/unit-stats.component';
import { UnitListPageComponent } from '~/pages/unit/containers/unit-list-page/unit-list-page.component';
import { UnitComponent } from '~/pages/unit/containers/unit/unit.component';
import { UnitSearchModalComponent } from './components/unit-search-modal/unit-search-modal.component';
import { UnitLandingComponent } from './containers/unit-landing/unit-landing.component';



const routes: Routes = [
    {
        path: '', component: UnitListPageComponent,
        children: [
            { path: "search-unit-modal", component: UnitSearchModalComponent }
        ]
    },
    { path: ':unitId', component: UnitLandingComponent },
    { path: 'info/:unitId', component: UnitComponent, data: { noReuse: true } },
    { path: 'functions/:unitId', component: UnitFunctionsComponent },
    { path: 'members/:unitId', component: UnitMembersComponent },
    { path: 'stats/:unitId', component: UnitStatsComponent }
];

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