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

{{#if @config}}
  {{#each this.displayFields as |field|}}
    {{! public key while not sensitive when editing/creating, should be hidden by default on viewing }}
    {{#if (eq field "public_key")}}
      <InfoTableRow @label="Public key" @value={{@config.public_key}}>
        <MaskedInput @value={{@config.public_key}} @name={{field}} @displayOnly={{true}} @allowCopy={{true}} />
      </InfoTableRow>
    {{else}}
      <InfoTableRow
        @alwaysRender={{not (is-empty-value (get @config field))}}
        @label={{this.label field}}
        @value={{get @config field}}
        @formatTtl={{this.isDuration field}}
      />
    {{/if}}
  {{/each}}
{{else}}
  {{! Prompt user to configure the secret engine }}
  <EmptyState
    data-test-config-cta
    @title="{{@typeDisplay}} not configured"
    @message="Get started by configuring your {{@typeDisplay}} secrets engine."
  >
    <Hds::Link::Standalone
      @icon="chevron-right"
      @iconPosition="trailing"
      @text="Configure {{@typeDisplay}}"
      @route="vault.cluster.secrets.backend.configuration.edit"
      @model={{@id}}
    />
  </EmptyState>
{{/if}}