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

{{keyboard-commands this.keyCommands}}

{{#if this.system.shouldShowRegions}}
  <span data-test-region-switcher-parent>
    <PowerSelect
      data-test-region-switcher
      @tagName="div"
      @triggerClass={{this.decoration}}
      @options={{this.sortedRegions}}
      @selected={{or this.system.activeRegion 'Select a Region'}}
      @searchEnabled={{false}}
      @onChange={{action this.gotoRegion}} as |region|>
      {{#if this.system.activeRegion}}
        <span class="ember-power-select-prefix">Region: </span>
      {{/if}}
      {{region}}
    </PowerSelect>
  </span>
{{else if this.system.hasNonDefaultRegion}}
  <div class="navbar-item single-region">
    <span>Region: </span>{{this.system.activeRegion}}
  </div>
{{/if}}
