@if (useNewItemDialog() && (canCreateCipher() || canCreateCollection() || canCreateFolder())) {
  <button
    bitButton
    [buttonType]="buttonType()"
    type="button"
    (click)="handleButtonClick()"
    id="newItemButton"
    [disabled]="disabled()"
    [appA11yTitle]="getButtonLabel() | i18n"
    [bitTooltip]="disabled() ? ('organizationIsSuspended' | i18n) : ''"
    [bitPopoverAnchorFor]="coachmarkPopover()"
    [popoverOpen]="coachmarkPopoverOpen()"
    [position]="coachmarkPosition()"
    [spotlight]="!!coachmarkPopover()"
    [startIcon]="icon()"
  >
    {{ getButtonLabel() | i18n }}
  </button>
} @else if (canCreateCipher() || canCreateCollection() || canCreateFolder()) {
  <div>
    <button
      bitButton
      [buttonType]="buttonType()"
      type="button"
      [bitMenuTriggerFor]="isOnlyCollectionCreation() ? null : addOptions"
      (click)="handleButtonClick()"
      id="newItemDropdown"
      [disabled]="disabled()"
      [appA11yTitle]="getButtonLabel() | i18n"
      [bitTooltip]="disabled() ? ('organizationIsSuspended' | i18n) : ''"
      [bitPopoverAnchorFor]="coachmarkPopover()"
      [popoverOpen]="coachmarkPopoverOpen()"
      [position]="coachmarkPosition()"
      [spotlight]="!!coachmarkPopover()"
      [closeOnBackdropClick]="false"
      [startIcon]="icon()"
    >
      {{ getButtonLabel() | i18n }}
    </button>
    <bit-menu #addOptions aria-labelledby="newItemDropdown">
      @for (item of cipherMenuItems$ | async; track item.type) {
        <button type="button" bitMenuItem (click)="cipherAdded.emit(item.type)">
          <i class="bwi {{ item.icon }}" slot="start" aria-hidden="true"></i>
          {{ item.labelKey | i18n }}
        </button>
      }
      @if (canCreateCipher()) {
        <bit-menu-divider></bit-menu-divider>
      }
      @if (canCreateFolder()) {
        <button type="button" bitMenuItem (click)="folderAdded.emit()">
          <i class="bwi bwi-fw bwi-folder" aria-hidden="true"></i>
          {{ "folder" | i18n }}
        </button>
      }
      @if (canCreateCollection()) {
        <button type="button" bitMenuItem (click)="collectionAdded.emit()">
          <bit-icon fixedWidth [name]="'bwi-collection-shared' | vfo1Icon" slot="start" />
          {{ "collection" | vfo1I18n: "sharedFolder" }}
        </button>
      }
    </bit-menu>
  </div>
}
