<ion-header>
<ion-toolbar color="primary">
  <ion-buttons slot="start">
    <ion-menu-button></ion-menu-button>
  </ion-buttons>
  <ion-title>{{'contracts.header' | translate}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
<h2 class="ion-text-capitalize" style="padding-bottom: 0.5em">{{'contracts.header_1' | translate}}</h2>
<ion-refresher slot="fixed" (ionRefresh)="refresh($event)">
  <ion-refresher-content></ion-refresher-content>
</ion-refresher>

  <ng-container *ngIf="loading">
    <ion-card *ngFor="let _ of [1,2]">
      <ion-item style="--border-color: #fff">
        <ion-label>
          <ion-skeleton-text [animated]="true" style="width: 55%; height: 18px; margin-bottom: 8px"></ion-skeleton-text>
          <ion-skeleton-text [animated]="true" style="width: 85%"></ion-skeleton-text>
          <ion-skeleton-text [animated]="true" style="width: 70%"></ion-skeleton-text>
          <ion-skeleton-text [animated]="true" style="width: 50%"></ion-skeleton-text>
          <ion-skeleton-text [animated]="true" style="width: 40%"></ion-skeleton-text>
          <ion-skeleton-text [animated]="true" style="width: 35%"></ion-skeleton-text>
          <ion-skeleton-text [animated]="true" style="width: 65%; height: 16px; margin-top: 6px"></ion-skeleton-text>
        </ion-label>
      </ion-item>
    </ion-card>
  </ng-container>

<ng-container *ngIf="!loading">
  <ion-card *ngFor="let pcontract of pcontracts; let i = index">
    <ion-item>
      <ion-label>
        <h2 *ngIf="lang===true" class="ion-text-capitalize">{{ pcontract.category }}</h2>
        <h2 *ngIf="lang===false" class="ion-text-capitalize">{{ pcontract.en_category }}</h2>
        <p class="ion-text-wrap">{{pcontract.address}}</p>
        <p class="ion-text-wrap ion-text-capitalize">{{pcontracts_dates[i]}}</p>
      </ion-label>
      <ion-button style="height: 3em; padding-left: 0.5em;" color="secondary" (click)="viewsuppliers(pcontract.id)">{{'contracts.viewsuppliers_1.1' | translate}}<br>{{'contracts.viewsuppliers_1.2' | translate}}</ion-button>
    </ion-item>
  </ion-card>
</ng-container>
</ion-content>
