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

<label
  for={{dasherize (or @title @value)}}
  class="radio-card {{if (eq @value @groupValue) 'is-selected'}} {{if @disabled 'is-disabled'}}"
  {{! these extra parentheses are necessary to conditionally apply the modifier }}
  {{! TODO: refactor this component and avoid this conditional modifier pattern }}
  {{(if @tooltipMessage (modifier "hds-tooltip" @tooltipMessage))}}
  ...attributes
>
  {{#if (has-block)}}
    {{yield}}
  {{else}}
    <div class="radio-card-row">
      <div>
        <Icon @name={{@icon}} @size="24" class={{or @iconClass "has-text-grey-light"}} />
      </div>
      <div class="has-left-margin-s">
        <p class="radio-card-message-title">
          {{@title}}
        </p>
        <p class="radio-card-message-body">
          {{@description}}
        </p>
      </div>
    </div>
  {{/if}}
  <div class="radio-card-radio-row">
    <RadioButton
      id={{dasherize (or @title @value)}}
      name="config-mode"
      class="radio"
      @disabled={{@disabled}}
      @value={{@value}}
      @groupValue={{@groupValue}}
      @onChange={{@onChange}}
    />
    <span class="dot"></span>
  </div>
</label>