import { Component, ChangeDetectionStrategy } from '@angular/core';
import { FileDTO } from '@swagger/eis';
import { UiModalRef } from '@ui/modal';
import { ImageViewerModalData } from './image-viewer-modal.data';

@Component({
  selector: 'page-image-viewer-modal',
  templateUrl: 'image-viewer-modal.component.html',
  styleUrls: ['image-viewer-modal.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ImageViewerModalComponent {
  file: FileDTO;

  content: Blob;

  constructor(private modalRef: UiModalRef<ImageViewerModalData>) {
    this.content = this.modalRef.data.content;
    this.file = this.modalRef.data.file;
  }

  close() {
    this.modalRef.close();
  }
}
