<div>
  <h2 id="page-heading" data-cy="InputDataUploadLogHeading">
    <span jhiTranslate="resilientApp.inputDataUploadLog.home.title">Input Data Upload Logs</span>

    <div class="d-flex justify-content-end">
      <button class="btn btn-info me-2" (click)="load()" [disabled]="isLoading">
        <fa-icon icon="sync" [spin]="isLoading"></fa-icon>
        <span jhiTranslate="resilientApp.inputDataUploadLog.home.refreshListLabel">Refresh list</span>
      </button>

      <button
        id="jh-create-entity"
        data-cy="entityCreateButton"
        class="btn btn-primary jh-create-entity create-input-data-upload-log"
        [routerLink]="['/input-data-upload-log/new']"
      >
        <fa-icon icon="plus"></fa-icon>
        <span jhiTranslate="resilientApp.inputDataUploadLog.home.createLabel">Criar novo(a) Input Data Upload Log</span>
      </button>
    </div>
  </h2>

  <jhi-alert-error></jhi-alert-error>

  <jhi-alert></jhi-alert>

  @if (inputDataUploadLogs?.length === 0) {
    <div class="alert alert-warning" id="no-result">
      <span jhiTranslate="resilientApp.inputDataUploadLog.home.notFound">Nenhum Input Data Upload Logs encontrado</span>
    </div>
  }

  @if (inputDataUploadLogs && inputDataUploadLogs.length > 0) {
    <div class="table-responsive table-entities" id="entities">
      <table class="table table-striped" aria-describedby="page-heading">
        <thead>
          <tr jhiSort [sortState]="sortState" (sortChange)="navigateToWithComponentValues($event)">
            <th scope="col" jhiSortBy="id">
              <div class="d-flex">
                <span jhiTranslate="global.field.id">Código</span>

                <fa-icon class="p-1" icon="sort"></fa-icon>
              </div>
            </th>
            <th scope="col" jhiSortBy="logMessage">
              <div class="d-flex">
                <span jhiTranslate="resilientApp.inputDataUploadLog.logMessage">Log Message</span>

                <fa-icon class="p-1" icon="sort"></fa-icon>
              </div>
            </th>
            <th scope="col" jhiSortBy="creationDate">
              <div class="d-flex">
                <span jhiTranslate="resilientApp.inputDataUploadLog.creationDate">Creation Date</span>

                <fa-icon class="p-1" icon="sort"></fa-icon>
              </div>
            </th>
            <th scope="col" jhiSortBy="creationUsername">
              <div class="d-flex">
                <span jhiTranslate="resilientApp.inputDataUploadLog.creationUsername">Creation Username</span>

                <fa-icon class="p-1" icon="sort"></fa-icon>
              </div>
            </th>
            <th scope="col" jhiSortBy="version">
              <div class="d-flex">
                <span jhiTranslate="resilientApp.inputDataUploadLog.version">Version</span>

                <fa-icon class="p-1" icon="sort"></fa-icon>
              </div>
            </th>
            <th scope="col" jhiSortBy="inputDataUpload.title">
              <div class="d-flex">
                <span jhiTranslate="resilientApp.inputDataUploadLog.inputDataUpload">Input Data Upload</span>
                <fa-icon class="p-1" icon="sort"></fa-icon>
              </div>
            </th>
            <th scope="col"></th>
          </tr>
        </thead>
        <tbody>
          @for (inputDataUploadLog of inputDataUploadLogs; track trackId) {
            <tr data-cy="entityTable">
              <td>
                <a [routerLink]="['/input-data-upload-log', inputDataUploadLog.id, 'view']">{{ inputDataUploadLog.id }}</a>
              </td>
              <td>{{ inputDataUploadLog.logMessage }}</td>
              <td>{{ inputDataUploadLog.creationDate | formatMediumDatetime }}</td>
              <td>{{ inputDataUploadLog.creationUsername }}</td>
              <td>{{ inputDataUploadLog.version }}</td>
              <td>
                @if (inputDataUploadLog.inputDataUpload) {
                  <div>
                    <a [routerLink]="['/input-data-upload', inputDataUploadLog.inputDataUpload.id, 'view']">{{
                      inputDataUploadLog.inputDataUpload.title
                    }}</a>
                  </div>
                }
              </td>
              <td class="text-end">
                <div class="btn-group">
                  <a
                    [routerLink]="['/input-data-upload-log', inputDataUploadLog.id, 'view']"
                    class="btn btn-info btn-sm"
                    data-cy="entityDetailsButton"
                  >
                    <fa-icon icon="eye"></fa-icon>
                    <span class="d-none d-md-inline" jhiTranslate="entity.action.view">Visualizar</span>
                  </a>

                  <a
                    [routerLink]="['/input-data-upload-log', inputDataUploadLog.id, 'edit']"
                    class="btn btn-primary btn-sm"
                    data-cy="entityEditButton"
                  >
                    <fa-icon icon="pencil-alt"></fa-icon>
                    <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Editar</span>
                  </a>

                  <button type="submit" (click)="delete(inputDataUploadLog)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
                    <fa-icon icon="times"></fa-icon>
                    <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Eliminar</span>
                  </button>
                </div>
              </td>
            </tr>
          }
        </tbody>
      </table>
    </div>
  }
</div>
