import { KeyValue, KeyValuePipe, NgForOf } from '@angular/common';
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { BaseDialogComponent, CircleButtonComponent, HumanizePipe } from '@iqser/common-ui';
import { IAudit } from '@red/domain';
import { TranslateModule } from '@ngx-translate/core';

interface DialogData {
    readonly auditEntry: IAudit;
}

type OrderFn = (a: KeyValue<string, string>, b: KeyValue<string, string>) => number;

@Component({
    selector: 'redaction-audit-info-dialog',
    templateUrl: './audit-info-dialog.component.html',
    styleUrls: ['./audit-info-dialog.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush,
    standalone: true,
    imports: [TranslateModule, NgForOf, KeyValuePipe, HumanizePipe, CircleButtonComponent],
})
export class AuditInfoDialogComponent extends BaseDialogComponent {
    constructor(
        protected readonly _dialogRef: MatDialogRef<AuditInfoDialogComponent>,
        @Inject(MAT_DIALOG_DATA) readonly data: DialogData,
    ) {
        super(_dialogRef, false);
    }

    readonly originalOrder: OrderFn = () => 0;

    async save(): Promise<void> {
        return;
    }
}
