import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatDividerModule } from '@angular/material/divider';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatIconModule } from '@angular/material/icon';
import { MatListModule } from '@angular/material/list';
import { MatMenuModule } from '@angular/material/menu';
import { MatPaginatorModule } from '@angular/material/paginator';
import { MatTreeModule } from '@angular/material/tree';
import { RouterModule } from '@angular/router';
import { ConfirmDialogComponent } from '../../core/components/confirm-dialog/confirm-dialog.component';
import { AnomaliesService } from './anomalies.service';
import { AnomalyListItemComponent } from './anomaly-list/anomaly-list-item/anomaly-list-item.component';
import { AnomalyListComponent } from './anomaly-list/anomaly-list.component';
import { AnomalySolutionDialogComponent } from './anomaly-list/anomaly-solution-dialog/anomaly-solution-dialog.component';
import { AnomalyTreeComponent } from './anomaly-tree/anomaly-tree.component';
import { AnomalyViewComponent } from './anomaly-view/anomaly-view.component';
import { ControlCenterDashboardComponent } from './control-center-dashboard.component';
import { ToursPerTimeKPIComponent } from './kpis/tours-per-time-kpi/tours-per-time-kpi.component';
import { TourViewDialogComponent } from './upcoming-tours/tour-view-dialog/tour-view-dialog.component';
import { UpcomingToursComponent } from './upcoming-tours/upcoming-tours.component';
import { OverviewDashboardComponent } from './overview-dashboard/overview-dashboard.component';
import { RoleDirective } from '../../core/components/ms-authentication/role.directive';

@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild([
      {
        path: '',
        component: ControlCenterDashboardComponent,
        children: [
          {
            path: 'overview',
            component: OverviewDashboardComponent,
          },
          {
            path: ':anomalyId',
            component: AnomalyViewComponent,
          },
          {
            path: '',
            pathMatch: 'full',
            redirectTo: 'overview'
          }
        ],
      },
    ]),
    MatGridListModule,
    MatCardModule,
    MatIconModule,
    MatMenuModule,
    MatListModule,
    MatButtonModule,
    MatDividerModule,
    MatTreeModule,
    MatPaginatorModule,
    ConfirmDialogComponent,
    RoleDirective,
  ],
  declarations: [
    ControlCenterDashboardComponent,
    OverviewDashboardComponent,
    AnomalyListComponent,
    AnomalyListItemComponent,
    AnomalySolutionDialogComponent,
    AnomalyTreeComponent,
    UpcomingToursComponent,
    ToursPerTimeKPIComponent,
    TourViewDialogComponent,
  ],
  providers: [AnomaliesService],
})
export class DashboardControlCenterModule {}
