<app-header>
  @if (!disableSend()) {
    <tools-new-send-dropdown></tools-new-send-dropdown>
  }
</app-header>

@if (disableSend()) {
  <bit-callout type="warning" title="{{ 'sendDisabled' | i18n }}">
    {{ "sendDisabledWarning" | i18n }}
  </bit-callout>
}

<div>
  <tools-send-list
    [sends]="filteredSends()"
    [loading]="loading()"
    [disableSend]="disableSend()"
    [listState]="listState()"
    [searchText]="currentSearchText()"
    (editSend)="editSend($event)"
    (copySend)="onCopySend($event)"
    (deleteSend)="deleteSend($event)"
    (removePassword)="onRemovePassword($event)"
  >
    <!-- Hide the filters if a single type of Send is allowed -->
    @if (allowedSendTypes().length !== 1) {
      <div class="tw-mt-4" slot="filters">
        <bit-toggle-group
          [selected]="selectedToggleValue"
          (selectedChange)="onToggleChange($event)"
          [label]="'filterSends' | i18n"
        >
          <bit-toggle [value]="'all'">{{ "allSends" | i18n }}</bit-toggle>
          <bit-toggle [value]="'text'">{{ "sendTypeText" | i18n }}</bit-toggle>
          <bit-toggle [value]="'file'">{{ "sendTypeFile" | i18n }}</bit-toggle>
        </bit-toggle-group>
      </div>
    }
    @if (!disableSend()) {
      <tools-new-send-dropdown [hideIcon]="true" slot="empty-button"></tools-new-send-dropdown>
    }
  </tools-send-list>
</div>
