{{!
  Copyright IBM Corp. 2016, 2025
  SPDX-License-Identifier: BUSL-1.1
}}

<div class="has-text-right">
  <Hds::Dropdown @isInline={{true}} @listPosition="bottom-right" as |dd|>
    <dd.ToggleIcon
      @icon="more-horizontal"
      @text="Identity policy management options"
      @hasChevron={{false}}
      data-test-popup-menu-trigger
    />
    <dd.Interactive @route="vault.cluster.policy.show" @models={{array "acl" @policyName}}>View policy</dd.Interactive>
    <dd.Interactive @route="vault.cluster.policy.edit" @models={{array "acl" @policyName}}>Edit policy</dd.Interactive>
    <dd.Interactive @color="critical" {{on "click" (fn (mut this.showConfirmModal) true)}}>
      Remove from
      {{@model.identityType}}
    </dd.Interactive>
  </Hds::Dropdown>
</div>

{{#if this.showConfirmModal}}
  <ConfirmModal
    @color="critical"
    @onClose={{fn (mut this.showConfirmModal) false}}
    @onConfirm={{this.removePolicy}}
    @confirmTitle="Remove this policy?"
    @confirmMessage="This policy may affect permissions to access Vault data."
  />
{{/if}}