<div>
  <h2 id="page-heading" data-cy="CategoriaHeading">
    <span jhiTranslate="dataSurveyApp.categoria.home.title">Categorias</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.categoria.home.refreshListLabel">Refresh List</span>
      </button>

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

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

  <jhi-alert></jhi-alert>

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

  <div class="table-responsive" id="entities" *ngIf="categorias && categorias.length > 0">
    <form class="ds-form">
      <div class="input-group">
        <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
        <input type="text" class="form-control" name="searchString" placeholder="Type to search..." [(ngModel)]="searchString" />
      </div>
    </form>
    <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.categoria.nombre">Nombre</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.categoria.estado">Estado</span></th>
          <th scope="col"></th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let categoria of categorias | filter: 'nombre':searchString; trackBy: trackId" data-cy="entityTable">
          <td>
            <a [routerLink]="['/categoria', categoria.id, 'view']">{{ categoria.id }}</a>
          </td>
          <td>{{ categoria.nombre }}</td>
          <td jhiTranslate="{{ 'dataSurveyApp.EstadoCategoria.' + categoria.estado }}">{{ categoria.estado }}</td>
          <td class="text-right">
            <div class="btn-group">
              <button
                type="submit"
                [routerLink]="['/categoria', categoria.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]="['/categoria', categoria.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(categoria)" 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>
