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

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

  constructor(
    @Inject(MAT_DIALOG_DATA) public dataReferences: Array<ReferencesData>,
    private _dialogRef: MatDialogRef<any>,
    public resourcesService: ResourcesService,
  ) {
    this.displayedColumns = [ 'RAZON_SOCIAL', 'CORREO', 'TELEFONO', 'RFC', 'DIRECCION', 'ACCIONES' ];
    this.dataSource = new MatTableDataSource(this.dataReferences);;
    
    this.isLoading = false;
  }

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