import { makeAutoObservable } from 'mobx';
import { ConditionalModalState } from './ConditionalModalState';
import { FieldOperationsBIReporter } from './FieldOperationsBIReporter';
export class ArchiveFieldModalState {
    constructor(params) {
        this.biReporter = new FieldOperationsBIReporter({
            reportBi: params.reportBi,
        });
        this.archiver = params.archiver;
        this.modal = new ConditionalModalState({
            onConfirm: async () => {
                if (!this.modal.value) {
                    return;
                }
                this.biReporter.reportArchiveFieldModalCtaClicked('Archive');
                await this.archiver.archiveField(this.modal.value.id, this.modal.value.origin);
            },
            onClose: () => {
                this.biReporter.reportArchiveFieldModalCtaClicked('Cancel');
            },
        });
        makeAutoObservable(this);
    }
}
//# sourceMappingURL=ArchiveFieldModalState.js.map