import { Component } from '@angular/core';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { UiModalRef } from '@ui/modal';

@Component({
  selector: 'page-web-viewer-modal',
  templateUrl: 'web-viewer-modal.component.html',
  styleUrls: ['./web-viewer-modal.component.scss'],
})
export class WebViewerModalComponent {
  src: SafeUrl;

  constructor(private sanitizer: DomSanitizer, private modalRef: UiModalRef<string>) {
    this.src = this.sanitizer.bypassSecurityTrustResourceUrl(this.modalRef.data);
  }

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