<td bitCell [ngClass]="RowHeightClass" class="tw-min-w-fit">
  @if (this.canEditCollection || this.canDeleteCollection) {
    <input
      type="checkbox"
      bitCheckbox
      appStopProp
      [disabled]="disabled"
      [checked]="checked"
      (change)="$event ? this.checkedToggled.next() : null"
      [attr.aria-label]="'collectionItemSelect' | vfo1I18n: 'sharedFolderItemSelect'"
    />
  }
</td>
<td bitCell [ngClass]="RowHeightClass" class="tw-min-w-fit">
  <div aria-hidden="true">
    <bit-icon
      fixedWidth
      class="bwi-lg"
      [name]="
        (collection.type === DefaultCollectionType ? 'bwi-user' : 'bwi-collection-shared')
          | vfo1Icon
      "
    />
  </div>
</td>
<td bitCell [ngClass]="RowHeightClass">
  <div class="tw-flex">
    <button
      bitLink
      [disabled]="disabled"
      type="button"
      class="tw-flex tw-text-start tw-leading-snug tw-max-w-56 tw-overflow-hidden"
      linkType="secondary"
      title="{{
        'viewCollectionWithName' | vfo1I18n: 'viewSharedFolderWithName' : collection.name
      }}"
      [routerLink]="[]"
      [queryParams]="{ collectionId: collection.id }"
      queryParamsHandling="merge"
      appStopProp
    >
      <div class="tw-truncate tw-mr-1 tw-max-w-56">{{ collection.name }}</div>
    </button>
    @if (showAddAccess) {
      <span
        bitBadge
        role="button"
        (click)="addAccess(CollectionPermission.Manage)"
        variant="warning"
        class="tw-cursor-pointer"
      >
        {{ "addAccess" | i18n }}
      </span>
    }
  </div>
</td>
@if (showOwner) {
  <td bitCell [ngClass]="RowHeightClass" class="tw-hidden lg:tw-table-cell">
    <app-org-badge
      [disabled]="disabled"
      [organizationId]="collection.organizationId"
      [organizationName]="collection.organizationId | orgNameFromId: organizations"
      appStopProp
    >
    </app-org-badge>
  </td>
}
@if (showCollections) {
  <td bitCell [ngClass]="RowHeightClass"></td>
}
@if (showGroups) {
  <td
    bitCell
    [ngClass]="RowHeightClass"
    class="tw-hidden tw-overflow-hidden tw-pr-7 xl:tw-table-cell tw-text-sm"
  >
    @if (collectionGroups) {
      <app-group-badge [selectedGroups]="collectionGroups" [allGroups]="groups"></app-group-badge>
    }
  </td>
}
@if (showPermissionsColumn) {
  <td bitCell [ngClass]="RowHeightClass" class="tw-hidden tw-pr-7 lg:tw-table-cell tw-text-sm">
    <p
      class="tw-mb-0 tw-truncate tw-text-muted"
      [bitTooltip]="permissionTooltip"
      [title]="permissionText"
    >
      {{ permissionText }}
    </p>
  </td>
}
<td bitCell [ngClass]="RowHeightClass" class="tw-text-right">
  @if (canEditCollection || canDeleteCollection || canViewCollectionInfo) {
    <button
      [disabled]="disabled"
      [bitMenuTriggerFor]="collectionOptions"
      size="small"
      bitIconButton="bwi-ellipsis-v"
      type="button"
      label="{{ 'options' | i18n }}"
      appStopProp
    ></button>
  }
  <bit-menu #collectionOptions>
    @if (canEditCollection) {
      <ng-container>
        <button type="button" bitMenuItem (click)="edit(false)">
          <i class="bwi bwi-fw bwi-pencil-square" aria-hidden="true"></i>
          {{ "editInfo" | i18n }}
        </button>
        <button type="button" bitMenuItem (click)="access(false)">
          <i class="bwi bwi-fw bwi-users" aria-hidden="true"></i>
          {{ "editAccess" | i18n }}
        </button>
      </ng-container>
    }
    @if (!canEditCollection && canViewCollectionInfo) {
      <ng-container>
        <button type="button" bitMenuItem (click)="edit(true)">
          <i class="bwi bwi-fw bwi-pencil-square" aria-hidden="true"></i>
          {{ "viewInfo" | i18n }}
        </button>
        <button type="button" bitMenuItem (click)="access(true)">
          <i class="bwi bwi-fw bwi-users" aria-hidden="true"></i>
          {{ "viewAccess" | i18n }}
        </button>
      </ng-container>
    }
    @if (canDeleteCollection) {
      <button type="button" variant="danger" bitMenuItem (click)="deleteCollection()">
        <bit-icon fixedWidth name="bwi-trash" slot="start" />
        {{ "delete" | i18n }}
      </button>
    }
  </bit-menu>
</td>
