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

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

  ngOnInit(): void {

  }

  ngOnChanges(){
    this.calendarList = this.updateMatTable(this.calendarList)
  }

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

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

}
