import { Component, Input } from '@angular/core';
import { ModalService } from 'src/services/modal/modal.service';

@Component({
  selector: 'deletion-confirm',
  templateUrl: './deletion-confirm.component.html',
  styleUrl: './deletion-confirm.component.scss',
})
export class DeletionConfirmComponent {
  @Input() name: string = '';

  public constructor(private modalAccessor: ModalService) {}

  ngOnInit() {
    console.log('DeletionConfirmComponent initialized');
  }

  // RESPONSES

  public cancel(): void {
    this.modalAccessor.handleModalClosing('cancel', undefined);
  }

  public delete(): void {
    this.modalAccessor.handleModalClosing('add', undefined);
  }
}
