<!--
~ 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/>.
-->

<ion-header>
  <ion-toolbar color="primary" mode="ios">
    <ion-buttons slot="start">
      <ion-back-button></ion-back-button>
    </ion-buttons>
    <ion-title>Licenses</ion-title>
    <!-- TODO: translation -->
  </ion-toolbar>
</ion-header>
<ion-content parallax>
  <div class="licenses-content">
    @for (license of licenses; track license) {
      <ion-card [href]="license.url || license.repository" rel="external" target="_blank">
        <ion-card-header>
          <ion-card-title>
            {{ license.name }}
            <ion-icon [size]="16" [weight]="300" class="supertext-icon" name="open_in_browser"></ion-icon>
          </ion-card-title>
          @if (license.authors || license.publisher) {
            <ion-card-subtitle> {{ license.authors || license.publisher }} </ion-card-subtitle>
          }
        </ion-card-header>
        <ion-card-content>
          <ion-chip (click)="$event.preventDefault(); viewLicense(license)">
            <ion-icon name="copyright"></ion-icon>
            <ion-label>{{ license.licenses }} License</ion-label>
          </ion-chip>
        </ion-card-content>
      </ion-card>
    }
  </div>
</ion-content>
