<ion-header>
<ion-toolbar color="primary">
  <ion-buttons slot="start">
    <ion-menu-button></ion-menu-button>
  </ion-buttons>
  <ion-title>{{'contract.header' | translate}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<h2 text-capitalize style="padding-bottom: 0.5em">{{'contracts.header_3' | translate}}</h2>
<ion-refresher slot="fixed" (ionRefresh)="refresh($event)">
  <ion-refresher-content></ion-refresher-content>
</ion-refresher>
  <ng-container *ngFor="let fcontract of fcontracts; let i = index">
    <ion-card>
      <ion-item style="--border-color: #fff">
        <ion-label>
          <h2 text-capitalize *ngIf="lang===true">{{ fcontract.category }}</h2>
          <h2 text-capitalize *ngIf="lang===false">{{ fcontract.en_category }}</h2>
          <h2 text-capitalize *ngIf="fcontract.parent">{{'contracts.parent' | translate}}</h2>
          <p text-wrap>{{ fcontract.address }}</p>
          <p text-wrap text-capitalize>{{ fcontracts_dates[i] }}</p>
          <p text-wrap text-capitalize>{{'contracts.supplier' | translate}}: {{ fcontract.supplier }}</p>
          <p text-wrap text-capitalize>{{'contracts.amount' | translate}}: ${{ fcontract.amount }}</p>
          <p>{{'contracts.status' | translate}}: {{ fcontract.status }}</p>
        </ion-label>
        </ion-item>
        <ion-row *ngIf="!fcontract.parent && fcontract.date_difference < 7 && fcontract.status !== 'cancelado'">
          <ion-col size="4">
            <ion-button *ngIf="!fcontract.scored && fcontract.status !== 'reportado'" expand="full" class="ion-text-wrap" color="secondary" (click)="reviewContract(fcontract.id)">{{'contracts.rate' | translate}}</ion-button>
          </ion-col>
          <ion-col size="4">
            <ion-button *ngIf="!fcontract.scored && fcontract.status !== 'reportado'" expand="full" class="ion-text-wrap" color="danger" (click)="reportContract(fcontract.id)">{{'contracts.report' | translate}}</ion-button>
          </ion-col>
        </ion-row>
    </ion-card>
  </ng-container>
</ion-content>
