<section>
  <ngx-datatable
    #resourcesTable
    class="material"
    [headerHeight]="headerHeight"
    [rowHeight]="rowHeight"
    columnMode="force"
    [footerHeight]="rowHeight"
    [rows]="resources"
    selectionType="single"
    [sorts]="sorts"
    [loadingIndicator]="isLoading"
    (select)="onSelect($event)">
    <ngx-datatable-column
      *ngIf="!isForInstance"
      name="Status"
      prop="alive"
      [width]="88"
      [resizeable]="false"
      [draggable]="false"
      [canAutoResize]="false">
      <ng-template let-value="value" ngx-datatable-cell-template>
        <mat-icon *ngIf="value" color="primary">lens</mat-icon>
        <mat-icon *ngIf="!value" color="warn" matTooltip="The resource is offline.">panorama_fish_eye</mat-icon>
      </ng-template>
    </ngx-datatable-column>
    <ngx-datatable-column
      *ngIf="isForInstance"
     [width]="50"
     [resizeable]="false"
     [sortable]="false"
     [draggable]="false"
     [canAutoResize]="false">
     <ng-template let-expanded="expanded" ngx-datatable-cell-template>
       <mat-icon>{{ expanded ? 'expand_more' : 'chevron_right' }}</mat-icon>
     </ng-template>
    </ngx-datatable-column>
    <ngx-datatable-column name="Name"></ngx-datatable-column>
    <ngx-datatable-row-detail rowHeight="auto">
      <ng-template let-row="row" ngx-datatable-row-detail-template>
        <hi-resource-detail-for-instance
          [clusterName]="clusterName"
          [instanceName]="instanceName"
          [resourceName]="row.name">
        </hi-resource-detail-for-instance>
      </ng-template>
    </ngx-datatable-row-detail>
  </ngx-datatable>
</section>
