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

<div [ngSwitch]="content.type">
  <markdown [data]="'value' | translateSimple: content" *ngSwitchCase="'markdown'"></markdown>
  <div *ngSwitchCase="'section'">
    <ion-card *ngIf="content.card; else noCard">
      <ion-card-header>
        <ion-card-title>{{ 'title' | translateSimple: content }}</ion-card-title>
      </ion-card-header>
      <ion-card-content>
        <about-page-content [content]="content.content"></about-page-content>
      </ion-card-content>
    </ion-card>
    <ng-template #noCard>
      <h2>{{ 'title' | translateSimple: content }}</h2>
      <about-page-content [content]="content.content"></about-page-content>
    </ng-template>
  </div>
  <ion-grid *ngSwitchCase="'table'">
    <ion-row *ngFor="let row of content.rows">
      <ion-col *ngFor="let col of row">
        <about-page-content [content]="col"></about-page-content>
      </ion-col>
    </ion-row>
  </ion-grid>
  <ion-item *ngSwitchCase="'router link'" [routerLink]="content.link" fill="clear">
    <ion-icon *ngIf="content.icon" [name]="content.icon" slot="start"></ion-icon>
    <ion-label>{{ 'title' | translateSimple: content }}</ion-label>
  </ion-item>
</div>
