{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

<PageHeader as |p|>
  <p.top>
    <KeyValueHeader
      @baseKey={{this.model}}
      @path="vault.cluster.secrets.backend"
      @root={{this.root}}
      @showCurrent={{true}}
    />
  </p.top>
  <p.levelLeft>
    <h1 class="title is-3" data-test-backend-configure-title={{this.model.type}}>
      Configure
      {{get (options-for-backend this.model.type) "displayName"}}
    </h1>
  </p.levelLeft>
</PageHeader>

<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 "aws")}}
  <SecretEngine::ConfigureAws
    @leaseConfig={{this.model.aws-lease-config}}
    @rootConfig={{this.model.aws-root-config}}
    @issuerConfig={{this.model.identity-oidc-config}}
    @backendPath={{this.model.id}}
  />
{{else if (eq this.model.type "ssh")}}
  <SecretEngine::ConfigureSsh @model={{this.model.ssh-ca-config}} @id={{this.model.id}} />
{{/if}}