import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { AddDossierDialogComponent } from '../dialogs/add-dossier-dialog/add-dossier-dialog.component';
import { ConfirmationDialogComponent, DialogConfig, DialogService } from '@iqser/common-ui';

type DialogType = 'addDossier' | 'confirm';

@Injectable()
export class SharedDialogService extends DialogService<DialogType> {
    protected readonly _config: DialogConfig<DialogType> = {
        confirm: {
            component: ConfirmationDialogComponent,
            dialogConfig: { disableClose: false },
        },
        addDossier: {
            component: AddDossierDialogComponent,
            dialogConfig: { width: '900px', autoFocus: true },
        },
    };

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