<h1 mat-dialog-title class="prevent-select">Buscar equipamiento</h1>
<div mat-dialog-content class="prevent-select">
  <div class="is-loading animated fadeIn fast" *ngIf="isLoading">
    <mat-spinner align="center"></mat-spinner>
    <h3>Cargando datos ...</h3>
  </div>
  <div class="has-error animated fadeIn pt-64" *ngIf="!isLoading && hasError">
    <mat-icon class="red_primary_font">error</mat-icon>
    <h2>{{ errorStr }}</h2>
  </div>
  <mat-form-field class="w-100 mt-8" appearance="outline" *ngIf="!isLoading && !hasError">
    <mat-label>Buscador</mat-label>
    <input matInput [(ngModel)]="txtBuscador" (keyup)="applyFilter($event,'INP')" placeholder="Ingrese la palabra a buscar" />
    <mat-icon *ngIf="txtBuscador.length === 0" matSuffix>search</mat-icon>
    <mat-icon *ngIf="txtBuscador.length> 0" class="clickable" matTooltip="Eliminar filtro"
    (click)="applyFilter('', 'EST')" matSuffix>close</mat-icon>
  </mat-form-field>
  <div class="animated fadeIn" [ngClass]="{ table_dialog_details_column: !isLoading && !hasError, hidden: isLoading }">
    <table mat-table [dataSource]="dataSource" matSort class="animated fadeIn">
      <ng-container matColumnDef="CODIGO">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Código</th>
        <td mat-cell *matCellDef="let element" style="overflow-wrap: anywhere;">{{ element.CODIGO }}</td>
      </ng-container>
      <ng-container matColumnDef="TIPO">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Tipo</th>
        <td mat-cell *matCellDef="let element">{{ element.TIPO }}</td>
      </ng-container>
      <ng-container matColumnDef="MODELO">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Modelo</th>
        <td mat-cell *matCellDef="let element">{{ element.MODELO }}</td>
      </ng-container>
      <ng-container matColumnDef="ID_EQUIPO">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>ID</th>
        <td mat-cell *matCellDef="let element">{{ element.ID_EQUIPO }}</td>
      </ng-container>
      <ng-container matColumnDef="ELEMENTO_ORIGEN">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Elemento</th>
        <td mat-cell *matCellDef="let element">{{ element.ELEMENTO_ORIGEN }}</td>
      </ng-container>
      <ng-container matColumnDef="ACCIONES">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Acciones</th>
        <td mat-cell *matCellDef="let element">
          <button mat-mini-fab color="primary" class="override_no_shadow" [matMenuTriggerFor]="menu">
            <mat-icon>settings</mat-icon>
          </button>
          <mat-menu #menu>
            <button mat-menu-item (click)="getEquipmentDetails(element.CODIGO)">
              <mat-icon>visibility</mat-icon>
              <span>Ver detalles</span>
            </button>
            <button mat-menu-item (click)="assignEquipment(element.CODIGO)">
              <mat-icon>done</mat-icon>
              <span>Asignar</span>
            </button>
          </mat-menu>
        </td>
      </ng-container>
      <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
      <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
      <tr class="mat-row" *matNoDataRow>
        <td class="mat-cell p-20 align-center" colspan="12">
          <object data="assets/img/empty_data.svg" width="300"></object>
          <h2>Sin datos</h2>
        </td>
      </tr>
    </table>
  </div>
  <mat-paginator [pageSizeOptions]="[10, 50, 100]" class="override-paginator" [ngClass]="{ hidden: isLoading }"></mat-paginator>
</div>
<div mat-dialog-actions align="end">
  <button mat-button mat-dialog-close>Cerrar</button>
</div>