{{!
  Copyright (c) HashiCorp, Inc.
  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 @text="Details" @route="vault.cluster.secrets.backend.show" @model={{@item.id}} />
          {{/if}}
          {{#if @item.updatePath.canUpdate}}
            <dd.Interactive @text="Edit" @route="vault.cluster.secrets.backend.edit" @model={{@item.id}} />
          {{/if}}
        </Hds::Dropdown>
      {{/if}}
    </div>
  </div>
</LinkedBlock>