<sm-table
  [selectionMode]="null"
  [tableData]="experiments"
  [columns]="INITIAL_EXPERIMENT_TABLE_COLS"
  [rowHeight]="40"
  [lazyLoading]="true"
  [keyboardControl]="true"
  [noMoreData]="true"
>
  <!--BODY TEMPLATE-->

  <ng-template let-col
               let-experiment="rowData"
               pTemplate="body">
    <ng-container [ngSwitch]="col.id">
      <div *ngSwitchCase="EXPERIMENTS_TABLE_COL_FIELDS.TYPE" class="table-cell-outline"
           [ngClass]="{'grayed':isThisRowSelected(experiment)}">
        {{experiment.type}}
      </div>
      <div *ngSwitchCase="EXPERIMENTS_TABLE_COL_FIELDS.ID" class="table-cell-outline">
        {{experiment.id}}
      </div>
      <div *ngSwitchCase="EXPERIMENTS_TABLE_COL_FIELDS.NAME" [ngClass]="{'grayed':isThisRowSelected(experiment)}">
        <div class="d-flex align-items-center">
          <div [innerHTML]="experiment.name | highlightSearchText:searchTerm"></div>
        </div>
      </div>
      <div *ngSwitchCase="EXPERIMENTS_TABLE_COL_FIELDS.USER" [ngClass]="{'grayed':isThisRowSelected(experiment)}">
        {{experiment.user?.name}}
      </div>
      <sm-tag-list *ngSwitchCase="EXPERIMENTS_TABLE_COL_FIELDS.TAGS" [tags]="experiment.tags"></sm-tag-list>
      <div *ngSwitchCase="EXPERIMENTS_TABLE_COL_FIELDS.PROJECT" [ngClass]="{'grayed':isThisRowSelected(experiment)}">
        {{experiment.project?.name}}
      </div>

      <sm-checkbox-control
        *ngSwitchCase="EXPERIMENTS_TABLE_COL_FIELDS.SELECTED"
        [isReadonly]="isThisRowSelected(experiment) && selectedExperiments.length<2"
        fieldName="selected" [formData]="isThisRowSelected(experiment)"
        (formDataChanged)="rowSelectedChanged($event, experiment)"
        inputClassName="add-or-remove">
      </sm-checkbox-control>
      <div class="d-flex" *ngSwitchCase="EXPERIMENTS_TABLE_COL_FIELDS.STATUS" [ngClass]="{'grayed':isThisRowSelected(experiment)}">
        <sm-experiment-status-icon-label [showIcon]="false" [status]="experiment?.status"></sm-experiment-status-icon-label>
      </div>
    </ng-container>
  </ng-template>
</sm-table>
