import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { fn } from '@ember/helper';
import { on } from '@ember/modifier';
import { eq } from 'ember-truth-helpers';
import argOrDefault from '../../helpers/arg-or-default.js';
import EuiPaginationButton from '../eui-pagination-button.js';

const ButtonWrapper = setComponentTemplate(precompileTemplate(`
    {{#if (argOrDefault @inList true)}}
      <li>
        <EuiPaginationButton
          @isActive={{eq @pageIndex @props.activePage}}
          @totalPages={{@props.pageCount}}
          @pageIndex={{@pageIndex}}
          aria-controls={{@props.ariaControls}}
          @hideOnMobile={{true}}
          {{on "click" (fn @props.safeClick @pageIndex)}}
        />
      </li>
    {{else}}
      <EuiPaginationButton
        @isActive={{eq @pageIndex @props.activePage}}
        @totalPages={{@props.pageCount}}
        @pageIndex={{@pageIndex}}
        aria-controls={{@props.ariaControls}}
        @hideOnMobile={{true}}
        {{on "click" (fn @props.safeClick @pageIndex)}}
      />
    {{/if}}
  `, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    EuiPaginationButton,
    eq,
    on,
    fn
  })
}), templateOnly("button-wrapper", "ButtonWrapper"));

export { ButtonWrapper as default };
//# sourceMappingURL=button-wrapper.js.map
