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

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

  constructor(
    @Inject(MAT_DIALOG_DATA) public dataReferences: Array<CatalogsData>,
    public resourcesService: ResourcesService,
  ) {
    this.displayedColumns = [ 'CATALOG','DESCRIPCION','ACCIONES' ];
    this.dataSource = new MatTableDataSource(this.dataReferences);
    this.isLoading = false;
  }

  public redirectLink(link: string) {
    window.open(link, '_blank');
  }
}
