import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { concat } from '@ember/helper';
import { gte, eq } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import EuiFlexGroup from './eui-flex-group.js';
import EuiFlexItem from './eui-flex-item.js';
import EuiIcon from './eui-icon.js';
import EuiPanel from './eui-panel.js';
import EuiSpacer from './eui-spacer.js';
import EuiTextComponent from './eui-text.js';
import EuiTextColor from './eui-text-color.js';
import EuiTitle from './eui-title.js';

const EuiEmptyPrompt = setComponentTemplate(precompileTemplate(`
    {{#let (argOrDefault @layout "vertical") as |layout|}}
      <EuiPanel
        class={{classNames
          (if
            layout (concat "euiEmptyPrompt--" layout) "euiEmptyPrompt--vertical"
          )
          componentName="EuiEmptyPrompt"
          paddingSize=(argOrDefault @paddingSize "l")
        }}
        @paddingSize="none"
        @color={{argOrDefault @color "transparent"}}
        @hasBorder={{@hasBorder}}
        @hasShadow={{false}}
        ...attributes
      >
        <div class="euiEmptyPrompt__main">
          {{#if (has-block "icon")}}
            <div class="euiEmptyPrompt__icon">{{yield to="icon"}}</div>
          {{else if @iconType}}
            <div class="euiEmptyPrompt__icon">
              <EuiIcon
                @type={{@iconType}}
                @size="xxl"
                @color={{if @iconColor @iconColor (if @color @color "subdued")}}
              />
            </div>
          {{/if}}
          <div class="euiEmptyPrompt__content">
            {{#if (has-block "content")}}
              <div class="euiEmptyPrompt__contentInner">{{yield
                  to="content"
                }}</div>
            {{else}}
              <div class="euiEmptyPrompt__contentInner">
                {{#if @title}}
                  <EuiTitle
                    @size={{argOrDefault @titleSize "m"}}
                  >{{@title}}</EuiTitle>
                {{/if}}
                {{#if @body}}
                  <EuiTextColor @color="subdued">
                    {{#if @title}}
                      <EuiSpacer @size="m" />
                    {{/if}}
                    <EuiText>
                      {{@body}}
                    </EuiText>
                  </EuiTextColor>
                {{/if}}
                {{#if (gte @actions.length 2)}}
                  <EuiSpacer size="l" />
                  <EuiFlexGroup
                    class="euiEmptyPrompt__actions"
                    @gutterSize="m"
                    @alignItems="center"
                    @justifyContent="center"
                    @direction={{if (eq layout "vertical") "column" "row"}}
                  >
                    {{#each @actions as |oneAction|}}
                      <EuiFlexItem @grow={{false}}>
                        {{oneAction}}
                      </EuiFlexItem>
                    {{/each}}
                  </EuiFlexGroup>
                {{else}}
                  <EuiSpacer size="l" />
                  {{#each @actions as |oneAction|}}
                    {{oneAction}}
                  {{/each}}
                {{/if}}
              </div>
            {{/if}}
          </div>
        </div>

        {{#if (has-block "footer")}}
          <div class="euiEmptyPrompt__footer">
            {{yield to="footer"}}
          </div>
        {{else}}
          {{#if @footer}}
            <div class="euiEmptyPrompt__footer">
              {{@footer}}
            </div>
          {{/if}}
        {{/if}}
      </EuiPanel>
    {{/let}}
  `, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    EuiPanel,
    classNames,
    concat,
    EuiIcon,
    EuiTitle,
    EuiTextColor,
    EuiSpacer,
    EuiText: EuiTextComponent,
    gte,
    EuiFlexGroup,
    eq,
    EuiFlexItem
  })
}), templateOnly("eui-empty-prompt", "EuiEmptyPrompt"));

export { EuiEmptyPrompt as default };
//# sourceMappingURL=eui-empty-prompt.js.map
