import { Component, OnInit } from '@angular/core';

const DATA_EXAMPLE: Array<any> = [
  {
    numeroGrupo: '0000000001',
    proveedor: 'Soler & Palau México',
    contacto: '',
    cantidad: '13',
  },
]


@Component({
  selector: 'app-group-provider',
  templateUrl: './group-provider.component.html',
  styleUrls: ['./group-provider.component.css']
})
export class GroupProviderComponent implements OnInit {

  public displayedColumns: string[] = [
    'ITEM1',
    'ITEM2',
    'ITEM3',
    'ITEM4',
    'ITEM5',
  ];

  public dataSource: any;

  public isLoading: boolean = false;
  public isLoadingForm: boolean = false;

  // ---- SmartPage ----
  public btnSmall: boolean = false;
  public card_size = 'card-size-normal mat-elevation-z8';

  constructor() {
    this.dataSource = DATA_EXAMPLE;
  }

  ngOnInit(): void {
    this.onResize();
  }

  // Método para reajustar la pantalla
  public onResize() {
    if (window.innerWidth <= 1400) {
      this.btnSmall = true;
      this.card_size = 'card-size-small';
    } else if (window.innerWidth > 1400) {
      this.btnSmall = false;
      this.card_size = 'card-size-normal mat-elevation-z8';
    }
  }

}
