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

{{! This display only template is for rendering control group errors when the error is thrown from a component }}

<Hds::Alert data-test-message-error @type="inline" @color="warning" ...attributes as |A|>
  <A.Title>Control Group Error</A.Title>
  {{#if (and @error.creation_path @error.token @error.accessor)}}
    <A.Description>
      A Control Group was encountered at
      <code>{{@error.creation_path}}</code>. The Control Group Token is
      <code>{{@error.token}}</code>. The Accessor is
      <code>{{@error.accessor}}</code>.
    </A.Description>
  {{/if}}
  {{#if (has-block "customMessage")}}
    <A.Description>
      {{yield to="customMessage"}}
    </A.Description>
  {{/if}}
  {{#if @error.href}}
    <A.Description>
      Visit
      <Hds::Link::Inline
        @color="primary"
        @href={{@error.href}}
        @isHrefExternal={{false}}
        data-test-control-error="href"
      >{{@error.href}}</Hds::Link::Inline>
      for more details.
    </A.Description>
  {{/if}}
</Hds::Alert>