import { Component, Inject } from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import { ConditionsData } from '../../../../../interfaces/acquisition-management/provider.interface';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';

@Component({
    selector: 'app-condition-provider',
    templateUrl: './condition-provider.component.html',
    styleUrl: './condition-provider.component.css',
    standalone: false
})
export class ConditionProviderComponent {
  public displayedColumns: Array<string>;
  public isLoading: boolean;
  public dataSource: MatTableDataSource<ConditionsData>;

  constructor(
    @Inject(MAT_DIALOG_DATA) public dataConditions: Array<ConditionsData>,
    private _dialogRef: MatDialogRef<any>
  ) {    
    this.displayedColumns = ['NUMERO_CONDICION', 'TIPO_CONDITION', 'ACCIONES'];
    this.dataSource = new MatTableDataSource(this.dataConditions);
    this.isLoading = false;
  }

  public openDialog(element:ConditionsData) {
    this._dialogRef.close(element);
  }
}
