<div>
  <h2 id="page-heading" data-cy="FacturaHeading">
    <span jhiTranslate="dataSurveyApp.factura.home.title">Facturas</span>

    <div class="d-flex justify-content-end">
      <button class="btn btn-info mr-2" (click)="loadAll()" [disabled]="isLoading">
        <fa-icon icon="sync" [spin]="isLoading"></fa-icon>
        <span jhiTranslate="dataSurveyApp.factura.home.refreshListLabel">Refresh List</span>
      </button>

      <button
        id="jh-create-entity"
        data-cy="entityCreateButton"
        class="btn btn-primary jh-create-entity create-factura"
        [routerLink]="['/factura/new']"
      >
        <fa-icon icon="plus"></fa-icon>
        <span jhiTranslate="dataSurveyApp.factura.home.createLabel"> Create a new Factura </span>
      </button>
    </div>
  </h2>

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

  <jhi-alert></jhi-alert>

  <div class="alert alert-warning" id="no-result" *ngIf="facturas?.length === 0">
    <span jhiTranslate="dataSurveyApp.factura.home.notFound">No facturas found</span>
  </div>

  <div class="table-responsive" id="entities" *ngIf="facturas && facturas.length > 0">
    <table class="table table-striped" aria-describedby="page-heading">
      <thead>
        <tr>
          <th scope="col"><span jhiTranslate="global.field.id">ID</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.factura.nombreUsuario">Nombre Usuario</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.factura.nombrePlantilla">Nombre Plantilla</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.factura.costo">Costo</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.factura.fecha">Fecha</span></th>
          <th scope="col"></th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let factura of facturas; trackBy: trackId" data-cy="entityTable">
          <td>
            <a [routerLink]="['/factura', factura.id, 'view']">{{ factura.id }}</a>
          </td>
          <td>{{ factura.nombreUsuario }}</td>
          <td>{{ factura.nombrePlantilla }}</td>
          <td>{{ factura.costo }}</td>
          <td>{{ factura.fecha | formatMediumDatetime }}</td>
          <td class="text-right">
            <div class="btn-group">
              <button
                type="submit"
                [routerLink]="['/factura', factura.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">View</span>
              </button>

              <button
                type="submit"
                [routerLink]="['/factura', factura.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">Edit</span>
              </button>

              <button type="submit" (click)="delete(factura)" 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">Delete</span>
              </button>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
