import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {RouterModule} from "@angular/router";
import {AuthGuard} from "@app/_helpers";
import {AdministrationPageComponent} from "@app/_modules/administration/page/administration-page.component";
import {BrowserModule} from "@angular/platform-browser";
import {AdministrateCompanyComponent} from "@app/_modules/administration/company/administrate-company.component";
import {AdministrateCommitteeComponent} from "@app/_modules/administration/committee/administrate-committee.component";
import {AdvisoriesModule} from "@app/_modules/advisories/advisories.module";
import {CompaniesModule} from "@app/_modules/companies/companies.module";

type PathMatch = "full" | "prefix" | undefined;
const routes = [
  {path: 'administrate', redirectTo: 'administrate/company', pathMatch: 'full' as PathMatch},
  {path: 'administrate/:tab', component: AdministrationPageComponent, canActivate: [AuthGuard]}
];

@NgModule({
  imports: [
    BrowserModule,
    CommonModule,
    RouterModule.forRoot(routes),
    AdvisoriesModule,
    CompaniesModule
  ],
  declarations: [
    AdministrationPageComponent,
    AdministrateCompanyComponent,
    AdministrateCommitteeComponent
  ],
  exports: [
    RouterModule
  ]
})
export class AdministrationModule {}
