import { Component, OnInit, ChangeDetectionStrategy, Input, ChangeDetectorRef, OnChanges } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Router, ActivatedRoute } from '@angular/router';
import { tap } from 'rxjs/operators';
import { BaseList } from 'src/app/core/base/base-list';
import { VEligibleCandidatesService } from 'src/app/core/service/testing-register/v-eligible-candidates.service';
import { DialogChangeRoomComponent } from 'src/app/feature/candidate-list/candidate-list/presenter/dialog/dialog-change-room/dialog-change-room.component';
import { DialogChangeSeatComponent } from 'src/app/feature/candidate-list/candidate-list/presenter/dialog/dialog-change-seat/dialog-change-seat.component';

@Component({
  selector: 'app-list',
  templateUrl: './list.component.html',
  styleUrls: ['./list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ListComponent extends BaseList implements OnInit, OnChanges {
  @Input() candidateList: any = [];
  constructor(
    private router: Router,
    public activeRouter: ActivatedRoute,
    private dialog: MatDialog,
    private cdf: ChangeDetectorRef,
  ) {
    super();
  }

  ngOnInit(): void {
  }

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

}
