import {Component, OnInit, ChangeDetectionStrategy, Input, OnChanges, ChangeDetectorRef, Output, EventEmitter} from '@angular/core';
import {BaseList} from '../../../../../../core/base/base-list';
import {MatDialog} from '@angular/material/dialog';
import {VEligibleCandidatesService} from '../../../../../../core/service/testing-register/v-eligible-candidates.service';

@Component({
  selector: 'app-receive-payment-list',
  templateUrl: './receive-payment-list.component.html',
  styleUrls: ['./receive-payment-list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ReceivePaymentListComponent extends BaseList implements OnInit, OnChanges {
  @Input() userPaymentdata: any = [];
  @Output() view = new EventEmitter();
  @Output() onRecieve = new EventEmitter();

  column = [ '1', '2', '3', '4', '5', '6', '7', '0'];
  constructor(
    private dialog: MatDialog,
    private cdf: ChangeDetectorRef,
  ) {
    super();
  }

  ngOnInit(): void {
  }

  ngOnChanges(){
    this.userPaymentdata = this.updateMatTable(this.userPaymentdata ? this.userPaymentdata : []);
    this.cdf.detectChanges();
  }

  onClickPublisher(data){
    console.log(data)
    const id = data.testing_register_uid;
    this.view.emit(id);
  }

  recieve(id){
    this.onRecieve.emit(id);
  }


}
