import { Component, OnInit, ChangeDetectionStrategy, EventEmitter, Output } from '@angular/core';
import { ModalService } from '@libs/ui';

@Component({
  selector: 'app-remission-confirm-delete-shipping-document',
  templateUrl: 'remission-confirm-delete-shipping-document-dialog.component.html',
  styleUrls: ['./remission-confirm-delete-shipping-document-dialog.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RemissionConfirmDeleteShippingDocumentDialogComponent implements OnInit {
  id = 'remission-confirm-delete-shipping-document';

  @Output()
  confirmDelete = new EventEmitter<boolean>();

  constructor(private modalService: ModalService) {}

  ngOnInit() {}

  public openDialog() {
    this.modalService.open(this.id);
  }

  onClickOutside() {}

  public closeDialog() {
    this.modalService.close(this.id);
  }

  confirmDeletion() {
    this.confirmDelete.emit(true);
    this.closeDialog();
  }
}
