<mat-menu #menu="matMenu" [hasBackdrop]="false" class="line-item" xPosition="before">
  <div
    class="action-tooltip"
    #menuHesitate="hesitate"
    [delay]="1000"
    [action]="'leave'"
    (smHesitate)="menu.closed.emit();"
  >
    <p class="command">{{command}}</p>
    <div class="w-100 d-flex action">
      <i class="al-icon al-ico-success sm me-1" [class.visible]="copySuccess"></i>
       <div
        class="d-flex-center copy-button pointer"
        ngxClipboard
        [cbContent]="command"
        (cbOnSuccess)="$event.event.stopPropagation(); copied()"
        >Copy command</div>
    </div>
  </div>
</mat-menu>
<span
  *ngIf="command"
  class="d-flex-center download-button"
  [delay]="1000" [action]="'leave'"
  (smHesitate)="menuHesitate.hesitateStatus && menu.closed.emit()"
>
  <button
    class="btn"
    data-id="downloadButton"
    [matMenuTriggerFor]="menu"
    (click)="openMenu(); menuHesitate.hesitateStatus = true"
  ><i class="al-icon al-ico-download pointer line-item"></i></button>
</span>
<sm-table
  [columns]="columns"
  [tableData]="tableData"
  [selectionMode]="null"
  [virtualScroll]="true"
  [scrollable]="true"
  [resizableColumns]="true"
  (columnResized)="resizeCol($event)"
>
  <ng-template
    let-col
    let-i="rowIndex"
    let-line="rowData"
    pTemplate="body">
    <div [ngSwitch]="col.id">
      <ng-container *ngSwitchCase="'name'">
        <span class="ellipsis" [attr.fileType]="line.name?.match('\\.([^ .]+)$')?.[1] || 'none'" smShowTooltipIfEllipsis [smTooltip]="line.name">{{line.name}}</span>
      </ng-container>
      <div *ngSwitchDefault class="ellipsis" smShowTooltipIfEllipsis [smTooltip]="line[col.id]">{{line[col.id]}}</div>
    </div>
  </ng-template>
</sm-table>
