<!--
~ Copyright (C) 2023 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/>.
-->

<stapps-section [title]="'dashboard.favorites.title' | translate">
  <ion-button slot="button-end" fill="clear" color="medium" [routerLink]="['/favorites']">
    <ion-icon slot="icon-only" name="search" [size]="24"></ion-icon>
  </ion-button>
  @if (items | async; as items) {
    <simple-swiper @fade>
      @for (item of items; track item) {
        <stapps-data-list-item
          [hideThumbnail]="true"
          [listItemEndInteraction]="false"
          [item]="item"
          appearance="square"
        ></stapps-data-list-item>
      }
    </simple-swiper>
  } @else {
    <ion-item class="nothing-selected" lines="none">
      <ion-label class="ion-text-wrap">
        {{ 'dashboard.favorites.no_favorite_prefix' | translate }}
        <a [routerLink]="'/search'">{{ 'dashboard.favorites.no_favorite_link' | translate }}</a>
        {{ 'dashboard.favorites.no_favorite_suffix' | translate }}
      </ion-label>
    </ion-item>
  }
</stapps-section>
