{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}
<ConditionalLinkTo
  @condition={{not (eq @status "unplaced")}}
  @route="allocations.allocation"
  @model={{@allocation.id}}
  @class="represented-allocation {{@status}} {{@health}} {{@canary}}"
  @label="View allocation"
  @tooltip={{if this.tooltipText
    (hash
      text=(or this.tooltipText '')
      extraTippyOptions=(hash trigger=(if (eq @status "unplaced") "manual"))
    )
    null
  }}
>
  {{#unless @steady}}
    {{#if (eq @canary "canary")}}
      <span class="alloc-canary-indicator" />
    {{/if}}
    {{#if (eq @status "running")}}
      <span class="alloc-health-indicator">
        {{#if (eq @health "healthy")}}
          <Hds::Icon @name="check" @color="white" @isInline={{true}} />
        {{else if (eq @health "unhealthy")}}
          <Hds::Icon @name="x" @color="white" @isInline={{true}} />
        {{else}}
          <Hds::Icon @name="running" @color="white" @isInline={{true}} />
        {{/if}}
      </span>
    {{/if}}
  {{/unless}}
</ConditionalLinkTo>
