<!--
  ~ Copyright (C) 2022 StApps
  ~ This program is free software: you can redistribute it and/or modify it
  ~ under the terms of the GNU General Public License as published by the Free
  ~ Software Foundation, version 3.
  ~
  ~ This program is distributed in the hope that it will be useful, but WITHOUT
  ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  ~ more details.
  ~
  ~ You should have received a copy of the GNU General Public License along with
  ~ this program. If not, see <https://www.gnu.org/licenses/>.
  -->

<ion-header>
  <ion-toolbar color="primary" mode="ios">
    <ion-buttons slot="start">
      <ion-back-button></ion-back-button>
    </ion-buttons>
    <ion-title>{{ 'library.account.pages.checked_out.title' | translate | titlecase }}</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ng-container *ngIf="checkedOutItems; else fallback">
    <stapps-paia-item
      *ngFor="let checkedOutItem of checkedOutItems"
      [item]="checkedOutItem"
      [propertiesToShow]="['label', 'renewals', 'endtime']"
      (documentAction)="onDocumentAction($event)"
      listName="checked_out"
    >
    </stapps-paia-item>
  </ng-container>
  <ng-template #fallback>
    <stapps-skeleton-list-item
      hideThumbnail="true"
      *ngIf="!checkedOutItems; else nothingFound"
    ></stapps-skeleton-list-item>
    <ng-template #nothingFound>
      <ion-label *ngIf="checkedOutItems && checkedOutItems.length === 0" class="centeredMessageContainer">
        {{ 'search.nothing_found' | translate | titlecase }}
      </ion-label>
    </ng-template>
  </ng-template>
</ion-content>
