<template>
  <div class="d-flex justify-content-center">
    <div class="col-8">
      <div v-if="notifica">
        <h2 class="jh-entity-heading" data-cy="notificaDetailsHeading">
          <span>{{ t$('smartbookingApp.notifica.detail.title') }}Notifica</span> {{ notifica.id }}
        </h2>
        <dl class="row-md jh-entity-details">
          <dt>
            <span>{{ t$('smartbookingApp.notifica.tipoCanale') }}</span>
          </dt>
          <dd>
            <span>{{ t$('smartbookingApp.TipoCanaleNotifica.' + notifica.tipoCanale) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.notifica.tipoEvento') }}</span>
          </dt>
          <dd>
            <span>{{ t$('smartbookingApp.TipoEventoNotifica.' + notifica.tipoEvento) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.notifica.messaggio') }}</span>
          </dt>
          <dd>
            <span>{{ notifica.messaggio }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.notifica.inviata') }}</span>
          </dt>
          <dd>
            <span>{{ notifica.inviata }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.notifica.inviataAt') }}</span>
          </dt>
          <dd>
            <span v-if="notifica.inviataAt">{{ formatDateLong(notifica.inviataAt) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.notifica.errore') }}</span>
          </dt>
          <dd>
            <span>{{ notifica.errore }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.notifica.createdAt') }}</span>
          </dt>
          <dd>
            <span v-if="notifica.createdAt">{{ formatDateLong(notifica.createdAt) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.notifica.conferma') }}</span>
          </dt>
          <dd>
            <div v-if="notifica.conferma">
              <router-link :to="{ name: 'ConfermaView', params: { confermaId: notifica.conferma.id } }">{{
                notifica.conferma.id
              }}</router-link>
            </div>
          </dd>
        </dl>
        <button type="submit" @click.prevent="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
          <font-awesome-icon icon="arrow-left"></font-awesome-icon>&nbsp;<span>{{ t$('entity.action.back') }}</span>
        </button>
        <router-link v-if="notifica.id" :to="{ name: 'NotificaEdit', params: { notificaId: notifica.id } }" custom v-slot="{ navigate }">
          <button @click="navigate" class="btn btn-primary">
            <font-awesome-icon icon="pencil-alt"></font-awesome-icon>&nbsp;<span>{{ t$('entity.action.edit') }}</span>
          </button>
        </router-link>
      </div>
    </div>
  </div>
</template>

<script lang="ts" src="./notifica-details.component.ts"></script>
