{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

{{#if this.nomadActions.actionsQueue.length}}
  {{#unless this.nomadActions.flyoutActive}}
    <div class="actions-flyout-button"
      {{keyboard-shortcut menuLevel=true pattern=(array "a" "c") action=(action this.nomadActions.openFlyout) }}
    >
      <Hds::Button
        {{on "click" this.nomadActions.openFlyout}}
        disabled={{this.nomadActions.flyoutActive}}
        @text={{if this.nomadActions.runningActions.length (concat this.nomadActions.runningActions.length " " (pluralize 'Action' this.nomadActions.runningActions.length) " Running") "Actions"}}
        @icon={{if this.nomadActions.runningActions.length "loading" "chevron-right"}}
        @iconPosition="trailing"
        @color="secondary"
      />
    </div>
  {{/unless}}
{{/if}}
