import { UiModalRef, UiModalService } from '@ui/modal';
import { KulturpassOrderModalData } from './kulturpass-order-modal.data';
import { KulturpassOrderModalComponent } from './kulturpass-order-modal.component';
import { inject, Injectable } from '@angular/core';
import { DisplayOrderDTO } from '@generated/swagger/oms-api';

@Injectable({ providedIn: 'root' })
export class KulturpassOrderModalService {
  private modal = inject(UiModalService);

  open(data: KulturpassOrderModalData): UiModalRef<[DisplayOrderDTO, string], KulturpassOrderModalData> {
    return this.modal.open<[DisplayOrderDTO, string], KulturpassOrderModalData>({
      content: KulturpassOrderModalComponent,
      data,
      config: {
        backdropClose: false,
      },
    });
  }
}
