import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CompositeRouteGuard, HasScrollbarDirective, IqserHelpModeModule, IqserListingModule, IqserRoutes } from '@iqser/common-ui';
import { TranslateModule } from '@ngx-translate/core';
import { DossiersListingScreenComponent } from './screen/dossiers-listing-screen.component';
import { RouterModule } from '@angular/router';
import { SharedModule } from '@shared/shared.module';
import { DossiersListingDetailsComponent } from './components/dossiers-listing-details/dossiers-listing-details.component';
import { ConfigService } from './config.service';
import { TableItemComponent } from './components/table-item/table-item.component';
import { SharedDossiersModule } from '../shared-dossiers/shared-dossiers.module';
import { DossierWorkloadColumnComponent } from './components/dossier-workload-column/dossier-workload-column.component';
import { DossierDocumentsStatusComponent } from './components/dossier-documents-status/dossier-documents-status.component';
import { DossierFilesGuard } from '@guards/dossier-files-guard';
import { ACTIVE_DOSSIERS_SERVICE } from '../../tokens';
import { IqserUsersModule } from '@iqser/common-ui/lib/users';
import { StatusBarComponent } from '@iqser/common-ui/lib/shared';

const routes: IqserRoutes = [
    {
        path: '',
        component: DossiersListingScreenComponent,
        pathMatch: 'full',
        canActivate: [CompositeRouteGuard],
        data: { routeGuards: [DossierFilesGuard], reuse: true, dossiersService: ACTIVE_DOSSIERS_SERVICE },
    },
];

@NgModule({
    declarations: [
        DossiersListingScreenComponent,
        DossiersListingDetailsComponent,
        DossierWorkloadColumnComponent,
        TableItemComponent,
        DossierDocumentsStatusComponent,
    ],
    providers: [ConfigService],
    imports: [
        RouterModule.forChild(routes),
        CommonModule,
        SharedModule,
        SharedDossiersModule,
        TranslateModule,
        IqserHelpModeModule,
        IqserUsersModule,
        IqserListingModule,
        StatusBarComponent,
        HasScrollbarDirective,
    ],
})
export class DossiersListingModule {}
