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

<LinkedBlock
  @params={{array "vault.cluster.secrets.backend.show" @item.id}}
  class="list-item-row"
  data-test-secret-link={{@item.id}}
  @encode={{true}}
  @queryParams={{secret-query-params @backendModel.type}}
>
  <div class="columns is-mobile">
    <div class="column is-10">
      <SecretLink
        @mode="show"
        @secret={{@item.id}}
        @backend={{@backendModel.id}}
        @queryParams={{if (eq @backendModel.type "transform") (hash tab="actions") ""}}
        class="has-text-black has-text-weight-semibold"
      >
        <Icon @name="file" class="has-text-grey-light" />
        {{if (eq @item.id " ") "(self)" (or @item.keyWithoutParent @item.id)}}
      </SecretLink>
    </div>
    <div class="column has-text-right">
      {{#if (or @item.updatePath.canRead @item.updatePath.canUpdate)}}
        <Hds::Dropdown @isInline={{true}} @listPosition="bottom-right" as |dd|>
          <dd.ToggleIcon
            @icon="more-horizontal"
            @text="Manage transformation"
            @hasChevron={{false}}
            data-test-popup-menu-trigger
          />
          {{#if @item.updatePath.canRead}}
            <dd.Interactive @route="vault.cluster.secrets.backend.show" @model={{@item.id}}>Details</dd.Interactive>
          {{/if}}
          {{#if @item.updatePath.canUpdate}}
            <dd.Interactive @route="vault.cluster.secrets.backend.edit" @model={{@item.id}}>Edit</dd.Interactive>
          {{/if}}
        </Hds::Dropdown>
      {{/if}}
    </div>
  </div>
</LinkedBlock>