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

{{#each-in @model.metadata as |key value|}}
  <div class="info-table-row is-mobile">
    <div class="is-flex is-fullwidth">
      <div class="column is-one-quarter">
        <span class="is-label has-text-grey-dark">
          {{key}}
        </span>
      </div>
      <div class="column is-5">
        {{value}}
      </div>
      <div class="column has-text-right">
        {{#if @model.canEdit}}
          <Identity::PopupMetadata @key={{key}} @model={{@model}} />
        {{/if}}
      </div>
    </div>
  </div>
{{else}}
  <EmptyState
    @title="No metadata for {{@model.name}}"
    @message='You can store custom data that you want to associate with this {{lowercase
      (humanize @model.identityType)
    }}. Click "Edit {{lowercase (humanize @model.identityType)}}" to get started.'
  >
    <Hds::Link::Standalone
      @text="Identity: entities and groups tutorial"
      @href={{doc-link "/vault/tutorials/auth-methods/identity"}}
      @icon="learn-link"
      @iconPosition="trailing"
    />
  </EmptyState>
{{/each-in}}