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

{{#if @isWriteWithoutRead}}
  <EmptyState
    data-test-write-without-read-empty-message
    @title="You do not have permission to read this secret."
    @message="Your policies permit you to overwrite this secret, but do not allow you to read it."
  />
{{else}}
  {{#if @showAdvancedMode}}
    <div class="has-top-margin-s">
      <JsonEditor @title="Secret Data" @value={{or (stringify @modelForData.secretData) " "}} @readOnly={{true}} />
    </div>
  {{else}}
    <div class="info-table-row-header">
      <div class="info-table-row thead">
        <div class="th column is-one-quarter">
          Key
        </div>
        <div class="th column">
          Value
        </div>
      </div>
    </div>
    {{#if @modelForData.secretKeyAndValue}}
      {{#each @modelForData.secretKeyAndValue as |secret|}}
        <InfoTableRow @label={{secret.key}} @value={{secret.value}} @alwaysRender={{true}}>
          <MaskedInput @name={{secret.key}} @value={{secret.value}} @displayOnly={{true}} @allowCopy={{true}} />
        </InfoTableRow>
      {{/each}}
    {{else}}
      {{! In the case of no key or value <InfoTableRow> will still render }}
      <InfoTableRow @label="" @value="" @alwaysRender={{true}}>
        <Icon @name="minus" />
      </InfoTableRow>
    {{/if}}
  {{/if}}
{{/if}}