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: 'app-action-button',
    templateUrl: './action-button.component.html',
    styleUrls: ['./action-button.component.scss'],
    encapsulation: ViewEncapsulation.None
  })
  export class ActionButtonComponent implements OnInit {
    // @Input() wishListModel: WishListModel;
    @Input() actionButtonModel: ActionButtonModel;
    
    @Output() methodToExecute: EventEmitter<CallbackModel> = new EventEmitter<
      CallbackModel
    >();
  
    constructor() {}
    CallReturnMethod(returnVal: CallbackModel) {
      // check method with params
      GenericHelper.CallReturnMethod<ActionButtonComponent>(returnVal, this);
    }
  
    ActionMethod(cm: CallbackModel) {
      this.methodToExecute.emit(cm);
    }
  
      ngOnInit() {}
  }
  