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

@Component({
  selector: 'app-remission-remove-product-from-shipping-document-dialog',
  templateUrl: './remission-remove-product-from-shipping-document-dialog.component.html',
  styleUrls: ['./remission-remove-product-from-shipping-document-dialog.component.scss'],
})
export class RemissionRemoveProductFromShippingDocumentDialogComponent implements OnInit {
  id = 'remission-remove-product-from-shipping-document-modal';
  @Output() remove = new EventEmitter();
  @Output() closed = new EventEmitter();
  loading = false;

  constructor(private modalService: ModalService) {}

  ngOnInit() {}

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

  closeDialog() {
    this.modalService.close(this.id);
    this.closed.emit();
  }

  removeProduct() {
    this.loading = true;
    this.remove.emit();
  }
}
