import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ConfirmationDialogComponent, DialogConfig, DialogService } from '@iqser/common-ui';
import { ChangeLegalBasisDialogComponent } from '../dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component';
import { DocumentInfoDialogComponent } from '../dialogs/document-info-dialog/document-info-dialog.component';
import { ForceAnnotationDialogComponent } from '../dialogs/force-redaction-dialog/force-annotation-dialog.component';
import { HighlightActionDialogComponent } from '../dialogs/highlight-action-dialog/highlight-action-dialog.component';
import { ManualAnnotationDialogComponent } from '../dialogs/manual-redaction-dialog/manual-annotation-dialog.component';
import { StructuredComponentManagementDialogComponent } from '../dialogs/structured-component-management-dialog/structured-component-management-dialog.component';

type DialogType = 'confirm' | 'documentInfo' | 'rss' | 'changeLegalBasis' | 'forceAnnotation' | 'manualAnnotation' | 'highlightAction';

@Injectable()
export class FilePreviewDialogService extends DialogService<DialogType> {
    protected readonly _config: DialogConfig<DialogType> = {
        confirm: {
            component: ConfirmationDialogComponent,
            dialogConfig: { disableClose: false },
        },
        documentInfo: {
            component: DocumentInfoDialogComponent,
            dialogConfig: { autoFocus: true },
        },
        changeLegalBasis: {
            component: ChangeLegalBasisDialogComponent,
        },
        forceAnnotation: {
            component: ForceAnnotationDialogComponent,
        },
        manualAnnotation: {
            component: ManualAnnotationDialogComponent,
            dialogConfig: { autoFocus: true },
        },
        highlightAction: {
            component: HighlightActionDialogComponent,
        },
        rss: {
            component: StructuredComponentManagementDialogComponent,
            dialogConfig: { width: '90vw' },
        },
    };

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