<template>
  <div class="d-flex justify-content-center">
    <div class="col-8">
      <div v-if="liberatoria">
        <h2 class="jh-entity-heading" data-cy="liberatoriaDetailsHeading">
          <span>{{ t$('smartbookingApp.liberatoria.detail.title') }}Liberatoria</span> {{ liberatoria.id }}
        </h2>
        <dl class="row-md jh-entity-details">
          <dt>
            <span>{{ t$('smartbookingApp.liberatoria.accettata') }}</span>
          </dt>
          <dd>
            <span v-if="liberatoria.accettata">{{ formatDateLong(liberatoria.accettata) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.liberatoria.utente') }}</span>
          </dt>
          <dd>
            <div v-if="liberatoria.utente">
              <router-link :to="{ name: 'UtenteAppView', params: { utenteAppId: liberatoria.utente.id } }">{{
                liberatoria.utente.username
              }}</router-link>
            </div>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.liberatoria.modelloLiberatoria') }}</span>
          </dt>
          <dd>
            <div v-if="liberatoria.modelloLiberatoria">
              <router-link :to="{ name: 'ModelloLiberatoriaView', params: { modelloLiberatoriaId: liberatoria.modelloLiberatoria.id } }">{{
                liberatoria.modelloLiberatoria.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="liberatoria.id"
          :to="{ name: 'LiberatoriaEdit', params: { liberatoriaId: liberatoria.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="./liberatoria-details.component.ts"></script>
