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

{{#if this.token.selfToken}}
  <Hds::Dropdown @color="secondary" class="profile-dropdown"
    {{keyboard-shortcut menuLevel=true pattern=(array "g" "p") }}
    as |dd|>
    <dd.ToggleIcon @color="secondary" @icon="user-circle" @text="user menu" @size="small" data-test-header-profile-dropdown />
    <dd.Title @text="Signed In" />
    <dd.Description @text={{this.token.selfToken.name}} />
    <dd.Separator />
    <dd.Interactive @route="settings.tokens" @text="Profile" data-test-profile-dropdown-profile-link />
    <dd.Interactive {{on "click" this.signOut}} @text="Sign Out" @color="critical" data-test-profile-dropdown-sign-out-link />
  </Hds::Dropdown>
{{else}}
  <LinkTo data-test-header-signin-link @route="settings.tokens" class="navbar-item" {{keyboard-shortcut menuLevel=true pattern=(array "g" "p") }}>
    Sign In
  </LinkTo>
{{/if}}

{{yield}}
