import { Component, OnInit, ChangeDetectionStrategy, Input, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'list',
  templateUrl: './list.component.html',
  styleUrls: ['./list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ListComponent implements OnInit {
  @Input() waitList: any = [];
  @Input() emptyList: any = [];
  @Input() aldyList: any = [];
  @Output() index = new EventEmitter()
  @Output() search = new EventEmitter()
  query = {
    student_code:null
  }
  constructor() { }

  ngOnInit(): void {
  }

  onSearch(){
    this.search.emit(this.query)
  }

  clear(){
    this.query = {
      student_code: null
    }
    this.search.emit(this.query)
  }

  onTabChanged(index){
    // console.log(index)
    this.index.emit(index.index)
  }

}
