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

{{#let (engines-display-data this.model.secretsEngine.type) as |engineDisplayData|}}
  <Page::Header
    @title="{{this.model.secretsEngine.id}} configuration"
    @description={{engineDisplayData.displayName}}
    @icon={{engineDisplayData.glyph}}
  >
    <:breadcrumbs>
      <Page::Breadcrumbs @breadcrumbs={{this.breadcrumbs}} />
    </:breadcrumbs>
    <:actions>
      <Hds::Button
        @color="secondary"
        @route={{exit-configuration-route this.model.secretsEngine.type this.model.secretsEngine.version}}
        @text="Exit configuration"
        data-test-button="Exit configuration"
      />
    </:actions>
  </Page::Header>
  <Mount::ConfigureTabs
    @configRoute="configuration.edit"
    @displayName={{engineDisplayData.displayName}}
    @path={{this.model.secretsEngine.id}}
  />
{{/let}}

<Toolbar>
  <ToolbarActions>
    <ToolbarLink @route="vault.cluster.secrets.backend" @model={{this.model.id}} data-test-backend-view-link>
      View backend
    </ToolbarLink>
  </ToolbarActions>
</Toolbar>

{{#if (eq this.model.type "ssh")}}
  <SecretEngine::ConfigureSsh @configForm={{this.model.configForm}} @id={{this.model.id}} />
  {{! This "else if" check is preventive. As of writing, all engines using this route, but "ssh", are wif engines }}
{{else if this.isWifEngine}}
  <SecretEngine::ConfigureWif
    @backendPath={{this.model.id}}
    @displayName={{this.displayName}}
    @type={{this.model.type}}
    @configForm={{this.model.configForm}}
  />
{{/if}}