import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '@shared/shared.module';
import { DictionaryScreenComponent } from './screens/dictionary/dictionary-screen.component';
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
import { EntityInfoComponent } from './screens/entity-info/entity-info.component';
import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor';
import { TranslateModule } from '@ngx-translate/core';
import { HasScrollbarDirective, IconButtonComponent, IqserDenyDirective, IqserHelpModeModule } from '@iqser/common-ui';

const routes: Routes = [
    { path: '', redirectTo: 'info', pathMatch: 'full' },
    {
        path: 'info',
        component: EntityInfoComponent,
        canDeactivate: [PendingChangesGuard],
    },
    {
        path: 'dictionary',
        component: DictionaryScreenComponent,
        canDeactivate: [PendingChangesGuard],
    },
    {
        path: 'false-positive',
        component: DictionaryScreenComponent,
        canDeactivate: [PendingChangesGuard],
    },
    {
        path: 'false-recommendations',
        component: DictionaryScreenComponent,
        canDeactivate: [PendingChangesGuard],
    },
];

@NgModule({
    declarations: [DictionaryScreenComponent, EntityInfoComponent],
    imports: [
        RouterModule.forChild(routes),
        CommonModule,
        SharedModule,
        MonacoEditorModule,
        TranslateModule,
        IqserHelpModeModule,
        IconButtonComponent,
        HasScrollbarDirective,
        IqserDenyDirective,
    ],
})
export class EntitiesModule {}
