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

@Component({
    selector: 'app-finance-is-main-false',
    templateUrl: './finance-is-main-false.component.html',
    styleUrls: ['./finance-is-main-false.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class FinanceIsMainFalseComponent extends BaseList implements OnInit, OnChanges {
    @Input() dataFalse: any = [];
    @Output() edit = new EventEmitter();
    @Output() delete = new EventEmitter();
    @Output() info = new EventEmitter();
    reload: boolean;
    column = [
        '1',
        'testing_information_name',
        'academic_semester_code',
        'academic_year_code',
        '12',
        'count_subject',
        'is_open',
        'created_by',
        'created_datetime',
        '8'
    ];
    constructor() {
        super();
    }

    ngOnInit(): void {
        this.reload = false;
        setTimeout(() => {
            this.reload = true;
        }, 2000);
    }

    ngOnChanges(){
        this.dataFalse = this.updateMatTable(this.dataFalse ? this.dataFalse : []);
    }

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

    onInfo(id){
        this.info.emit(id);
    }

    onDelete(id){
        this.delete.emit(id);
    }

}
