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

@if (origin.type === 'user') {
  <h3>
    {{ 'data.types.origin.TITLE' | translate | sentencecase }}:
    {{ 'data.types.origin.USER' | translate | sentencecase }}
  </h3>
  <p>
    {{ 'data.types.origin.detail.CREATED' | translate | sentencecase }}:
    {{ origin.created | amDateFormat: 'll' }}
  </p>
  @if (origin.updated) {
    <p>
      {{ 'data.types.origin.detail.UPDATED' | translate | sentencecase }}:
      {{ origin.updated | amDateFormat: 'll' }}
    </p>
  }
  @if (origin.modified) {
    <p>
      {{ 'data.types.origin.detail.MODIFIED' | translate | sentencecase }}:
      {{ origin.modified | amDateFormat: 'll' }}
    </p>
  }
  @if (origin.maintainer) {
    <p>
      {{ 'data.types.origin.detail.MAINTAINER' | translate | sentencecase }}:
      <a [routerLink]="['/data-detail', origin.maintainer.uid]">{{ origin.maintainer.name }}</a>
    </p>
  }
}
@if (origin.type === 'remote') {
  <h3>
    {{ 'data.types.origin.TITLE' | translate | sentencecase }}:
    {{ 'data.types.origin.REMOTE' | translate | sentencecase }}
  </h3>
  <p>
    {{ 'data.types.origin.detail.INDEXED' | translate | sentencecase }}:
    {{ origin.indexed | amDateFormat: 'll' }}
  </p>
  @if (origin.modified) {
    <p>
      {{ 'data.types.origin.detail.MODIFIED' | translate | sentencecase }}:
      {{ origin.modified | amDateFormat: 'll' }}
    </p>
  }
  @if (origin.name) {
    <p>{{ 'data.types.origin.detail.MAINTAINER' | translate | sentencecase }}: {{ origin.name }}</p>
  }
  @if (origin.maintainer) {
    <p>
      {{ 'data.types.origin.detail.MAINTAINER' | translate | sentencecase }}:
      <a [routerLink]="['/data-detail', origin.maintainer.uid]">{{ origin.maintainer.name }}</a>
    </p>
  }
  @if (origin.responsibleEntity) {
    <p>
      {{ 'data.types.origin.detail.RESPONSIBLE' | translate | sentencecase }}:
      <a [routerLink]="['/data-detail', origin.responsibleEntity.uid]">{{ origin.responsibleEntity.name }}</a>
    </p>
  }
}
