<bit-item-action>
  <button
    type="button"
    bitIconButton="bwi-ellipsis-v"
    size="small"
    [label]="'moreOptionsLabelNoPlaceholder' | i18n"
    [bitMenuTriggerFor]="moreOptions"
  ></button>
  <bit-menu #moreOptions>
    @if (!decryptionFailure) {
      @if (canAutofill && showAutofill() && autofillAllowed$ | async) {
        <button type="button" bitMenuItem (click)="doAutofill()">
          {{ "autofillVerb" | i18n }}
        </button>
      }
      @if (showViewOption()) {
        <button type="button" bitMenuItem (click)="onView()">
          {{ "view" | i18n }}
        </button>
      }
      <button type="button" bitMenuItem (click)="toggleFavorite()">
        {{ favoriteText | i18n }}
      </button>
      @if (canEdit) {
        <button type="button" bitMenuItem (click)="edit()">
          {{ "edit" | i18n }}
        </button>
      }
      @if (canEdit && canViewPassword) {
        @if (canClone$ | async) {
          <a bitMenuItem (click)="clone()">
            {{ "clone" | i18n }}
          </a>
        }
        @if (canAssignCollections$ | async) {
          <a bitMenuItem (click)="conditionallyNavigateToAssignCollections()">
            {{ "assignToCollections" | vfo1I18n: "addToSharedFolder" }}
          </a>
        }
      }
      @if (canArchive$ | async) {
        <button type="button" bitMenuItem (click)="archive()">
          {{ "archiveVerb" | i18n }}
        </button>
      } @else {
        <button
          type="button"
          bitMenuItem
          (click)="badge.promptForPremium($event)"
          [attr.aria-label]="'upgradeToUseArchive' | i18n"
        >
          <div class="tw-flex tw-flex-nowrap tw-items-center tw-gap-2">
            {{ "archiveVerb" | i18n }}
            <div aria-hidden>
              <app-premium-badge #badge></app-premium-badge>
            </div>
          </div>
        </button>
      }
    }
    @if (canDelete$ | async) {
      <button type="button" bitMenuItem variant="danger" (click)="delete()">
        {{ "delete" | i18n }}
      </button>
    }
  </bit-menu>
</bit-item-action>
