<pa-avatar
  size="small"
  [avatar]="avatar"
  [paPopup]="userMenu"></pa-avatar>

<pa-dropdown #userMenu>
  <pa-option
    icon="user"
    (click)="goProfile()">
    {{ 'generic.user_preferences' | translate }}
  </pa-option>
  @if ((isBillingEnabled | async) && (isAccountManager | async) && !noStripe) {
    <pa-separator></pa-separator>
    <pa-option
      icon="payment"
      (click)="goToBilling()">
      {{ 'account.billing' | translate }}
    </pa-option>
  }
  @if (accounts.length > 1 || standalone) {
    <pa-separator></pa-separator>
    <pa-option
      icon="reload"
      (click)="switchAccount()">
      {{ 'generic.switch_account' | translate }}
    </pa-option>
  }
  @if ((simpleMode | async) && (isKbAdmin | async)) {
    <pa-option
      data-cy="go-to-manage-users"
      icon="users"
      (click)="goToManageUsers()">
      {{ 'account.manage_users' | translate }}
    </pa-option>
  }
  @if (!standalone && (isAccountManager | async) === true && !(isCowork | async)) {
    <pa-option
      data-cy="go-to-manage-account"
      icon="account"
      (click)="goToManageAccount()">
      {{ 'account.manage' | translate }}
    </pa-option>
  }
  @if ((isCowork | async) && (isAccountManager | async)) {
    <pa-option
      data-cy="delete-account"
      icon="trash"
      (click)="openDeleteAccount()">
      {{ 'account.delete_account' | translate }}
    </pa-option>
  }

  <pa-separator></pa-separator>
  <pa-option
    icon="warning"
    (click)="goToSupport()">
    {{ 'generic.report_bug' | translate }}
  </pa-option>
  <pa-separator></pa-separator>
  <pa-option
    data-cy="logout"
    icon="log-out"
    (click)="logout()">
    {{ 'generic.logout' | translate }}
  </pa-option>
</pa-dropdown>
