import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { eq } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import EuiIcon from './eui-icon.js';
import EuiLoadingSpinner from './eui-loading-spinner.js';

const EuiButtonContent = setComponentTemplate(precompileTemplate(`
    <span
      class={{classNames
        "euiButtonContent"
        (if (eq @iconSide "right") "euiButtonContent--iconRight")
      }}
      ...attributes
    >
      {{#if @isLoading}}
        <EuiLoadingSpinner
          class="euiButtonContent__spinner"
          {{!@glint-expect-error}}
          @size={{argOrDefault @iconSize "m"}}
        />
      {{else if @iconType}}
        <EuiIcon
          @iconClasses="euiButtonContent__icon {{@iconClasses}}"
          @type={{@iconType}}
          @size={{argOrDefault @iconSize "m"}}
          @useSvg={{@useSvg}}
          @useComponent={{@useComponent}}
          @color="inherit"
        />
      {{/if}}
      <span class={{@textClasses}}>
        {{yield}}
      </span>
    </span>
  `, {
  strictMode: true,
  scope: () => ({
    classNames,
    eq,
    EuiLoadingSpinner,
    argOrDefault,
    EuiIcon
  })
}), templateOnly("eui-button-content", "EuiButtonContent"));

export { EuiButtonContent as default };
//# sourceMappingURL=eui-button-content.js.map
