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

@Component({
  selector: 'academic-years-list',
  templateUrl: './academic-years-list.component.html',
  styleUrls: ['./academic-years-list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class AcademicYearsListComponent extends BaseList implements OnInit,OnChanges {
  column = ['1', '2', '3', '4', '5', '6'];
  @Input() academicYearList: any = [];
  @Output() edit = new EventEmitter()
  @Output() delete = new EventEmitter()
  constructor() {
    super()
   }

  ngOnInit(): void {
  }

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

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

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

}
