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

<TabPageHeader @model={{@backend}} @breadcrumbs={{@breadcrumbs}}>
  <ToolbarLink @route="configure" data-test-toolbar-config-action>
    {{if @config "Edit configuration" "Configure Kubernetes"}}
  </ToolbarLink>
</TabPageHeader>

{{#if @config}}
  {{#if @config.disableLocalCaJwt}}
    <InfoTableRow @label="Kubernetes host" @value={{@config.kubernetesHost}} />
    {{#if @config.kubernetesCaCert}}
      <InfoTableRow @label="Certificate">
        <CertificateCard @data={{@config.kubernetesCaCert}} @isPem={{true}} />
      </InfoTableRow>
    {{/if}}
  {{else}}
    <div class="has-top-margin-l" data-test-inferred-message>
      <Icon @name="check-circle-fill" class="has-text-success" />
      <span>
        These details were successfully inferred from Vault’s kubernetes environment and were not explicity set in this
        config.
      </span>
    </div>
  {{/if}}
{{else}}
  <ConfigCta />
{{/if}}

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