<template>
  <div class="d-flex justify-content-center">
    <div class="col-8">
      <div v-if="auditLog">
        <h2 class="jh-entity-heading" data-cy="auditLogDetailsHeading">
          <span>{{ t$('smartbookingApp.auditLog.detail.title') }}AuditLog</span> {{ auditLog.id }}
        </h2>
        <dl class="row-md jh-entity-details">
          <dt>
            <span>{{ t$('smartbookingApp.auditLog.entitaTipo') }}</span>
          </dt>
          <dd>
            <span>{{ t$('smartbookingApp.TipoEntita.' + auditLog.entitaTipo) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.auditLog.entitaId') }}</span>
          </dt>
          <dd>
            <span>{{ auditLog.entitaId }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.auditLog.azione') }}</span>
          </dt>
          <dd>
            <span>{{ t$('smartbookingApp.AzioneAudit.' + auditLog.azione) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.auditLog.dettagli') }}</span>
          </dt>
          <dd>
            <span>{{ auditLog.dettagli }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.auditLog.ipAddress') }}</span>
          </dt>
          <dd>
            <span>{{ auditLog.ipAddress }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.auditLog.createdAt') }}</span>
          </dt>
          <dd>
            <span v-if="auditLog.createdAt">{{ formatDateLong(auditLog.createdAt) }}</span>
          </dd>
          <dt>
            <span>{{ t$('smartbookingApp.auditLog.utente') }}</span>
          </dt>
          <dd>
            <div v-if="auditLog.utente">
              <router-link :to="{ name: 'UtenteAppView', params: { utenteAppId: auditLog.utente.id } }">{{
                auditLog.utente.username
              }}</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="auditLog.id" :to="{ name: 'AuditLogEdit', params: { auditLogId: auditLog.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="./audit-log-details.component.ts"></script>
