import { Component, EventEmitter, Input, Output } from '@angular/core';

@Component({
  selector: 'app-confirm-modal',
  templateUrl: './confirm-modal.component.html',
  styleUrls: ['./confirm-modal.component.scss'],
})
export class ConfirmModalComponent {
  @Input() isVisible = false;
  @Input() title = 'Title';
  @Input() description = 'Description';

  @Output() isVisibleChange = new EventEmitter<boolean>();
  @Output() onConfirm = new EventEmitter<void>();
  @Output() onCancel = new EventEmitter<void>();

  handleConfirm() {
    this.isVisibleChange.emit(false);
    this.onConfirm.emit();
  }

  handleCancel() {
    this.isVisibleChange.emit(false);
    this.onCancel.emit();
  }
}
