import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { EditDossierDialogComponent } from '../dialogs/edit-dossier-dialog/edit-dossier-dialog.component';
import { AssignReviewerApproverDialogComponent } from '../dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component';
import { ConfirmationDialogComponent, DialogConfig, DialogService, largeDialogConfig } from '@iqser/common-ui';
import { ImportRedactionsDialogComponent } from '../../file-preview/dialogs/import-redactions-dialog/import-redactions-dialog';
import { DictionaryDetailsDialogComponent } from '../dialogs/edit-dossier-dialog/dictionary/dictionary-details-dialog/dictionary-details-dialog.component';

type DialogType = 'confirm' | 'editDossier' | 'assignFile' | 'importRedactions' | 'editDictionaryDetails';

@Injectable({
    providedIn: 'root',
})
export class DossiersDialogService extends DialogService<DialogType> {
    protected readonly _config: DialogConfig<DialogType> = {
        confirm: {
            component: ConfirmationDialogComponent,
            dialogConfig: { disableClose: false },
        },
        editDossier: {
            component: EditDossierDialogComponent,
            dialogConfig: { ...largeDialogConfig },
        },
        assignFile: {
            component: AssignReviewerApproverDialogComponent,
            dialogConfig: { disableClose: false },
        },
        importRedactions: {
            component: ImportRedactionsDialogComponent,
            dialogConfig: { disableClose: false },
        },
        editDictionaryDetails: {
            component: DictionaryDetailsDialogComponent,
            dialogConfig: { disableClose: false },
        },
    };

    constructor(protected readonly _dialog: MatDialog) {
        super(_dialog);
    }
}
