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

<Page::Header @title={{titleize (pluralize this.identityType)}}>
  <:breadcrumbs>
    <Page::Breadcrumbs
      @breadcrumbs={{array
        (hash label="Vault" route="vault.cluster.dashboard" icon="vault")
        (hash label=(titleize (pluralize this.identityType)))
      }}
    />
  </:breadcrumbs>
</Page::Header>

<nav class="tabs" aria-label="navigation for entities">
  <ul>
    <li>
      <LinkTo @route="vault.cluster.access.identity.index" @model={{pluralize this.identityType}}>
        {{capitalize (pluralize this.identityType)}}
      </LinkTo>
    </li>
    <li>
      <LinkTo @route="vault.cluster.access.identity.aliases.index" @model={{pluralize this.identityType}}>
        Aliases
      </LinkTo>
    </li>
  </ul>
</nav>

<Toolbar>
  {{#if this.model.meta.total}}
    <ToolbarFilters>
      <Identity::LookupInput @type={{this.identityType}} />
    </ToolbarFilters>
  {{/if}}
  <ToolbarActions>
    {{#if (eq this.identityType "entity")}}
      <ToolbarLink
        @route={{"vault.cluster.access.identity.merge"}}
        @model={{pluralize this.identityType}}
        data-test-entity-merge-link={{true}}
      >
        Merge
        {{pluralize this.identityType}}
      </ToolbarLink>
    {{/if}}
    <ToolbarLink
      @route="vault.cluster.access.identity.create"
      @model={{pluralize this.identityType}}
      @type="add"
      data-test-entity-create-link={{true}}
    >
      Create
      {{this.identityType}}
    </ToolbarLink>
  </ToolbarActions>
</Toolbar>