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

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

@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 },
        },
        importRedactions: {
            component: ImportRedactionsDialogComponent,
            dialogConfig: { disableClose: false },
        },
    };

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