import {
  Component,
  OnInit,
  Input,
  ViewEncapsulation,
  Output,
  EventEmitter
} from '@angular/core';
import { ActionButtonModel } from '../../models/action-button-model';
import { CallbackModel } from '../../models/callback-model';
import { GenericHelper } from '../../helpers/generic-helper';

@Component({
  selector: 'sts-action-button',
  templateUrl: './action-button.component.html',
  styleUrls: ['./action-button.component.scss']
})
export class ActionButtonComponent {
  @Input() actionButtonModel: ActionButtonModel;

  @Output() methodToExecute: EventEmitter<CallbackModel> = new EventEmitter<
    CallbackModel
  >();

  constructor() {}
  // CallReturnMethod(returnObj: CallbackModel) {
  //   console.log(returnObj);
  //   GenericHelper.CallReturnMethod<ActionButtonComponent>(returnObj, this);
  // }

  ActionMethod(obj: CallbackModel) {
    this.methodToExecute.emit(obj);
  }
}
