import {Component, OnInit, ChangeDetectionStrategy, Input, Output, EventEmitter, OnChanges} from '@angular/core';
import {BaseList} from '../../../../../../core/base/base-list';
import {SweetalertService} from '../../../../../../core/service/sweetalert/sweetalert';
import {TestingFieldService} from '../../../../../../core/service/settings/testing-field.service';

@Component({
  selector: 'app-department-list',
  templateUrl: './department-list.component.html',
  styleUrls: ['./department-list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class DepartmentListComponent extends BaseList implements OnInit , OnChanges {
  @Input() departmentList: any = [];
  @Output() edit = new EventEmitter();
  @Output() delete = new EventEmitter();
  column = ['0','1', '2', 'faculty_name_th','3', '4', '5', '6'];
  constructor(
    private swSV: SweetalertService,
    private testingfieldSV: TestingFieldService,
  ) {
    super();
  }

  ngOnInit(): void {
  }

  ngOnChanges(){
    this.departmentList = this.updateMatTable(this.departmentList);
  }

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

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

}
