<template>
  <div class="d-flex justify-content-center">
    <div class="col-8">
      <div v-if="modelloLiberatoria">
        <h2 class="jh-entity-heading" data-cy="modelloLiberatoriaDetailsHeading">
          <span>{{ t$('smartbookingApp.modelloLiberatoria.detail.title') }}ModelloLiberatoria</span> {{ modelloLiberatoria.id }}
        </h2>
        <dl class="row-md jh-entity-details">
          <dt>
            <span>{{ t$('smartbookingApp.modelloLiberatoria.nome') }}</span>
          </dt>
          <dd>
            <span>{{ modelloLiberatoria.nome }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.modelloLiberatoria.testo') }}</span>
          </dt>
          <dd>
            <span>{{ modelloLiberatoria.testo }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.modelloLiberatoria.documento') }}</span>
          </dt>
          <dd>
            <span>{{ modelloLiberatoria.documento }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.modelloLiberatoria.validoDal') }}</span>
          </dt>
          <dd>
            <span v-if="modelloLiberatoria.validoDal">{{ formatDateLong(modelloLiberatoria.validoDal) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.modelloLiberatoria.validoAl') }}</span>
          </dt>
          <dd>
            <span v-if="modelloLiberatoria.validoAl">{{ formatDateLong(modelloLiberatoria.validoAl) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.modelloLiberatoria.struttura') }}</span>
          </dt>
          <dd>
            <div v-if="modelloLiberatoria.struttura">
              <router-link :to="{ name: 'StrutturaView', params: { strutturaId: modelloLiberatoria.struttura.id } }">{{
                modelloLiberatoria.struttura.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="modelloLiberatoria.id"
          :to="{ name: 'ModelloLiberatoriaEdit', params: { modelloLiberatoriaId: modelloLiberatoria.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="./modello-liberatoria-details.component.ts"></script>
