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

<Page::Header @title={{this.title}} @subtitle={{this.subtitle}}>
  <:breadcrumbs>
    <KeyValueHeader
      @baseKey={{@model}}
      @path="vault.cluster.secrets.backend.list"
      @mode={{@mode}}
      @root={{this.breadcrumbs}}
      @showCurrent={{true}}
    />
  </:breadcrumbs>
</Page::Header>

{{#if (eq @mode "show")}}
  <Totp::KeyDetails @model={{@model}} @onDelete={{this.deleteKey}} />
{{else if (eq @mode "create")}}
  {{#if this.hasGenerated}}
    <Totp::KeyQrCode @model={{@model}} @onReset={{this.reset}} />
  {{else}}
    <Totp::KeyCreate
      @onSubmit={{this.createKey}}
      @model={{@model}}
      @defaultKeyFormFields={{this.defaultKeyFormFields}}
      @groups={{this.groups}}
      @modelValidations={{this.modelValidations}}
      @invalidFormAlert={{this.invalidFormAlert}}
    />
  {{/if}}
{{/if}}