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

<div
  class={{concat "stat-text-container " @size (unless @subText "-no-subText")}}
  data-test-stat-text={{or @label "true"}}
  ...attributes
>
  <div class="stat-label has-bottom-margin-xs">
    {{@label}}
    {{#if @tooltipText}}
      <Hds::TooltipButton @text={{@tooltipText}} aria-label="more information about {{@label}}">
        <Hds::Icon @name="info" @isInline={{true}} />
      </Hds::TooltipButton>
    {{/if}}
  </div>
  {{#if @subText}}
    <div class="stat-text">{{@subText}}</div>
  {{/if}}
  {{! Ember reads 0 as falsy, so only render a dash if the value is truly undefined}}
  <div class="stat-value">{{if (or @value (eq @value 0)) (format-number @value) "-"}}</div>
</div>