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

<SecretListHeader @model={{this.model.secretsEngine}} @isConfigure={{true}} />

{{#if this.isConfigurable}}
  <Toolbar>
    <ToolbarActions>
      <ToolbarLink
        @route="vault.cluster.secrets.backend.configuration.edit"
        @model={{this.model.secretsEngine.id}}
        data-test-secret-backend-configure
      >
        Configure
      </ToolbarLink>
    </ToolbarActions>
  </Toolbar>

  <SecretEngine::ConfigurationDetails @config={{this.model.config}} @typeDisplay={{this.typeDisplay}} @id={{this.modelId}} />

  <SecretsEngineMountConfig
    @secretsEngine={{this.model.secretsEngine}}
    class="has-top-margin-xl has-bottom-margin-xl"
    data-test-mount-config
  />

{{else}}
  <div class="box is-fullwidth is-sideless is-paddingless is-marginless">
    {{#each this.displayFields as |field|}}
      <InfoTableRow
        @alwaysRender={{and (not (is-empty-value (get this.model.secretsEngine field))) (not-eq field "version")}}
        @formatTtl={{includes field (array "config.default_lease_ttl" "config.max_lease_ttl")}}
        @label={{this.label field}}
        @value={{get this.model.secretsEngine field}}
      />
    {{/each}}
  </div>
{{/if}}