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

@Component({
  selector: 'notification-check-exam-list',
  templateUrl: './notification-check-exam-list.component.html',
  styleUrls: ['./notification-check-exam-list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class NotificationCheckExamListComponent extends BaseList implements OnInit, OnChanges {
  @Input() subjectList: any = [];
  column = [
    '1',
    'testing_information_code',
    'testing_information_name',
    'academic_semester_code',
    'academic_year_code',
    '8',
    'count_subject',
    'is_open',
    'created_by',
    'created_datetime',
    '7'
  ];
  reload: boolean;

  @Output() view = new EventEmitter();
  constructor(
  ) {
    super();
  }

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

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

  onView(id){
    this.view.emit(id);
  }

}
