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

interface Country {
  id?: number;
  equip: string;
  name: string;
  sdate: string;
  edate: string;
}

const COUNTRIES: Country[] = [
  {
    equip: 'string',
    name: 'ray',
    sdate: 'string',
    edate: 'string'
  }

];

@Component({
  selector: 'app-pending',
  templateUrl: './pending.component.html',
  styleUrls: ['./pending.component.scss']
})
export class PendingComponent implements OnInit {
  page = 1;
  pageSize = 10;
  collectionSize = COUNTRIES.length;
  countries: Country[];

  constructor() {
    this.refreshCountries();
  }

  refreshCountries() {
    this.countries = COUNTRIES
      .map((country, i) => ({ id: i + 1, ...country }))
      .slice((this.page - 1) * this.pageSize, (this.page - 1) * this.pageSize + this.pageSize);
  }

  ngOnInit(): void {
  }

}
