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

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

    constructor() {
        super();
    }

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

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

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

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

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

}
