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


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

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

  ngOnInit(): void {
  }

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

}
