import { Component, OnInit, ChangeDetectionStrategy, Input, Output, EventEmitter, OnChanges } from '@angular/core';
import { BaseList } from 'src/app/core/base/base-list';

@Component({
    selector: 'invigilate-finance-list',
    templateUrl: './invigilate-finance-list.component.html',
    styleUrls: ['./invigilate-finance-list.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class InvigilateFinanceListComponent extends BaseList implements OnInit,OnChanges {
    @Input() invigilateList: any = [];
    @Input() acdmSem: any = [];
    @Input() acdmYear: any = [];
    @Output() edit = new EventEmitter()
    @Output() delete = new EventEmitter()
    column = ['8','1','2','3','4','6','7']
    constructor() {
        super()
     }

    ngOnInit(): void {
    }

    ngOnChanges(){
        // console.log(this.invigilateList)
        if(this.invigilateList) this.invigilateList = this.invigilateList.data? this.invigilateList : this.updateMatTable(this.invigilateList)
        // this.invigilateList = this.updateMatTable(this.invigilateList? this.invigilateList: [])
    }

    onEdit(id){
        this.edit.emit(id)
    }

    onDelete(uid){
        this.delete.emit(uid)
    }

}
