import { Component, OnInit } from '@angular/core';

import { ModalService } from '@libs/ui';
import { ModalConfirmationService } from '@sales/core-services';

@Component({
  selector: 'app-remission-started-leave-dialog',
  templateUrl: './remission-started-leave-dialog.component.html',
  styleUrls: ['./remission-started-leave-dialog.component.scss'],
})
export class RemissionStartedLeaveDialogComponent implements OnInit {
  id = 'remission-started-leave-modal';
  constructor(private modalService: ModalService, private modalConfirmationService: ModalConfirmationService) {}

  ngOnInit() {}

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

  cancel() {
    this.close();
    this.modalConfirmationService.close();
  }

  confirm() {
    this.close();
    this.modalConfirmationService.close(true);
  }

  private close() {
    this.modalService.close(this.id);
  }
}
