import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ActionsLayout } from '@progress/kendo-angular-dialog';

@Component({
  selector: 'app-confirmation',
  templateUrl: './confirmation.component.html',
  styleUrls: ['./confirmation.component.scss']
})
export class ConfirmationComponent implements OnInit {
  @Input() opened = false;
  @Input() title = 'Confirma';
  @Input() message = 'Confirma processamento?';
  @Input() detailMessage = '';
  @Input() textButtonConfirmation = 'Ok';
  @Input() textButtonCancel = 'Cancelar';
  @Output() resultEvent = new EventEmitter<boolean>();
  public actionsLayout: ActionsLayout = 'normal';

  public onDialogClose(): void {
    this.resultEvent.emit(false);
  }

  public onDeleteData(): void {
    this.opened = false;
    this.resultEvent.emit(true);
  }

  public open(): void {
    this.opened = true;
  }

  constructor() { }

  ngOnInit() {
  }

}
