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

@if (content.type === 'markdown') {
  <markdown [data]="'value' | translateSimple: content"></markdown>
}
@if (content.type === 'section') {
  <div>
    @if (content.card) {
      <ion-card>
        <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>
    } @else {
      <h2>{{ 'title' | translateSimple: content }}</h2>
      <about-page-content [content]="content.content"></about-page-content>
    }
  </div>
}
@if (content.type === 'table') {
  <ion-grid>
    @for (row of content.rows; track row) {
      <ion-row>
        @for (col of row; track col) {
          <ion-col>
            <about-page-content [content]="col"></about-page-content>
          </ion-col>
        }
      </ion-row>
    }
  </ion-grid>
}
@if (content.type === 'router link') {
  <ion-item [routerLink]="content.link">
    @if (content.icon) {
      <ion-icon [name]="$any(content.icon)" slot="start"></ion-icon>
    }
    <ion-label>{{ 'title' | translateSimple: content }}</ion-label>
  </ion-item>
}
