import { Component, OnInit, ChangeDetectionStrategy, OnChanges, Input } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { BaseList } from 'src/app/core/base/base-list';
import { ReasonDialogComponent } from '../../dialog/reason-dialog/reason-dialog/reason-dialog.component';

@Component({
  selector: 'alrdy-list',
  templateUrl: './alrdy-list.component.html',
  styleUrls: ['./alrdy-list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class AlrdyListComponent extends BaseList implements OnInit,OnChanges {
  list;
  @Input() aldyList : any = [];
  column = ['1','2','3','4','5','6','7','8','9','10']
  constructor(
    private dialog: MatDialog
  ) {
    super()
   }

  ngOnInit(): void {
  }

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

  reason(x){
    const dialogRef = this.dialog.open(ReasonDialogComponent, {
      width: '90vh',
      data: x,
    });
  }

}
