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

<Page::Header
  @icon={{@backend.icon}}
  @title={{if @configRoute (concat @backend.id " configuration") @backend.id}}
  @subtitle={{if @configRoute "PKI Certificates"}}
>
  <:breadcrumbs>
    <Page::Breadcrumbs @breadcrumbs={{or @breadcrumbs this.breadcrumbs}} />
  </:breadcrumbs>

  <:actions>
    <CodeGenerator::Policy::Flyout @policyPaths={{this.policyPaths}} />
    {{#if @configRoute}}
      <Hds::Button @color="secondary" @route="overview" @text="Exit configuration" data-test-button="Exit configuration" />
    {{else}}
      <ManageDropdown @model={{@backend}} @configRoute="configuration" />
    {{/if}}
  </:actions>
</Page::Header>

{{#if @configRoute}}
  <Mount::ConfigureTabs
    @configRoute={{@configRoute}}
    @displayName="PKI Certificates"
    @path={{@backend.id}}
    @externalRoute="secretsGeneralSettingsConfiguration"
  />
{{else}}
  <nav class="tabs" aria-label="pki tabs">
    <ul>
      <li><LinkTo @route="overview" @model={{@backend.id}} data-test-secret-list-tab="Overview">Overview</LinkTo></li>
      <li><LinkTo @route="roles" @model={{@backend.id}} data-test-secret-list-tab="Roles">Roles</LinkTo></li>
      <li><LinkTo @route="issuers" @model={{@backend.id}} data-test-secret-list-tab="Issuers">Issuers</LinkTo></li>
      <li><LinkTo @route="keys" @model={{@backend.id}} data-test-secret-list-tab="Keys">Keys</LinkTo></li>
      <li><LinkTo
          @route="certificates"
          @model={{@backend.id}}
          data-test-secret-list-tab="Certificates"
        >Certificates</LinkTo></li>
      <li><LinkTo @route="tidy" @model={{@backend.id}} data-test-secret-list-tab="Tidy">Tidy</LinkTo></li>
    </ul>
  </nav>
{{/if}}