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

<div class="box is-shadowless is-marginless is-fullwidth">
  {{#if @model.disabled}}
    <Hds::Alert data-test-disabled-warning @type="inline" @color="warning" class="has-bottom-margin-s" as |A|>
      <A.Title>Attention</A.Title>
      <A.Description>
        This
        {{@model.identityType}}
        is disabled. All associated tokens cannot be used, but are not revoked.
      </A.Description>
      {{#if @model.canEdit}}
        <A.Button data-test-enable-identity @text="Enable" @color="secondary" {{on "click" (action "enable" @model)}} />
      {{/if}}
    </Hds::Alert>
  {{/if}}
  <InfoTableRow @label="Name" @value={{@model.name}} data-test-identity-item-name={{true}} />
  <InfoTableRow @label="Type" @value={{@model.type}} />
  <InfoTableRow @label="ID" @value={{@model.id}} @addCopyButton={{true}} />
  <InfoTableRow @label="Merged Ids" @value={{@model.mergedEntityIds}}>
    <div>
      {{#each @model.mergedEntityIds as |id|}}
        <div>
          <code class="has-text-black">{{id}}</code>
        </div>
      {{/each}}
    </div>
  </InfoTableRow>
  <InfoTableRow @label="Created" @value={{@model.creationTime}}>
    <time datetime={{@model.creationTime}} title={{@model.creationTime}}>
      {{date-format @model.creationTime "MMM dd, yyyy h:mm a"}}
    </time>
  </InfoTableRow>
  <InfoTableRow @label="Last Updated" @value={{this.model.lastUpdateTime}}>
    <time datetime={{this.model.lastUpdateTime}} title={{this.model.lastUpdateTime}}>
      {{date-format this.model.lastUpdateTime "MMM dd, yyyy h:mm a"}}
    </time>
  </InfoTableRow>
</div>