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

<ng-container *ngIf="contactPoints">
  <ion-card *ngFor="let contactPoint of contactPoints; let i = index">
    <ion-card-header>
      <ng-container *ngIf="contactPoints.length > 1">{{ i + 1 }}.</ng-container>
      {{ 'type' | thingTranslate : contactPoint | titlecase }}
    </ion-card-header>
    <ion-card-content>
      <p *ngIf="contactPoint.telephone">
        {{ 'telephone' | propertyNameTranslate : contactPoint | titlecase }}:
        <a [href]="'tel:' + contactPoint.telephone">{{ contactPoint.telephone }}</a>
      </p>
      <p *ngIf="contactPoint.email">
        {{ 'email' | propertyNameTranslate : contactPoint | titlecase }}:
        <a [href]="'mailto:' + contactPoint.email">{{ contactPoint.email }}</a>
      </p>
      <p *ngIf="contactPoint.faxNumber">
        {{ 'faxNumber' | propertyNameTranslate : contactPoint | titlecase }}: {{ contactPoint.faxNumber }}
      </p>
      <p *ngIf="contactPoint.officeHours">
        {{ 'officeHours' | propertyNameTranslate : contactPoint | titlecase }}: {{ contactPoint.officeHours }}
      </p>
      <p *ngIf="contactPoint.url">
        {{ 'url' | propertyNameTranslate : contactPoint | titlecase }}:
        <a [href]="contactPoint.url">{{ contactPoint.url }}</a>
      </p>
      <p *ngIf="contactPoint.areaServed">
        {{ 'areaServed' | propertyNameTranslate : contactPoint | titlecase }}:
        <a [routerLink]="['/data-detail', contactPoint.areaServed.uid]">{{ contactPoint.areaServed.name }}</a>
      </p>
    </ion-card-content>
  </ion-card>
</ng-container>
<stapps-simple-card
  *ngIf="item.jobTitles?.length > 0"
  [title]="'jobTitles' | propertyNameTranslate : item | titlecase"
  [content]="item.jobTitles"
></stapps-simple-card>
