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

<div class="columns">
  <div class="column">
    <PageHeader as |p|>
      <p.top>
        <Page::Breadcrumbs @breadcrumbs={{this.breadcrumbs}} />
      </p.top>
      <p.levelLeft>
        <h1 class="title is-3">
          <SecretLink
            class="is-inline has-text-info"
            @secret={{this.model.id}}
            @backend={{this.model.backend}}
            @mode="show"
            @replace={{true}}
            @queryParams={{hash tab="actions"}}
            data-test-transit-link="actions"
          >
            <Icon @name="arrow-left" />
          </SecretLink>
          Key Actions
        </h1>
      </p.levelLeft>
    </PageHeader>

    <div class="tabs-container box is-sideless is-fullwidth is-paddingless is-marginless">
      <nav class="tabs">
        <ul>
          {{#each this.model.supportedActions as |supportedAction|}}
            <li class={{if (eq supportedAction.name this.selectedAction) "is-active"}}>
              <SecretLink
                @mode="actions"
                @backend={{this.model.backend}}
                @secret={{this.model.id}}
                @queryParams={{hash action=supportedAction.name}}
                data-test-transit-action-link={{supportedAction.name}}
              >
                {{#if (eq supportedAction.name "export")}}
                  Export Key
                {{else if (eq supportedAction.name "hmac")}}
                  HMAC
                {{else}}
                  {{humanize supportedAction.name}}
                {{/if}}
              </SecretLink>
            </li>
          {{/each}}
        </ul>
      </nav>
    </div>
    <TransitKeyActions @selectedAction={{this.selectedAction}} @key={{this.model}} />
  </div>
</div>