<template>
  <view :class="emptyClass" :style="emptyStyle">
    <view :class="bem.e('icon')" :style="iconStyle">
      <slot name="icon">
        <sar-icon :name="icon" :family="iconFamily" />
      </slot>
    </view>
    <slot name="description">
      <view :class="bem.e('description')">
        {{ description || t('noData') }}
      </view>
    </slot>
    <view v-if="$slots.default" :class="bem.e('extra')">
      <slot></slot>
    </view>
  </view>
</template>

<script lang="ts">
import { defineComponent as _defineComponent } from "vue";
import { computed } from "vue";
import { classNames, stringifyStyle, createBem } from "../utils";
import SarIcon from "../icon/icon.vue";
import { useTranslate } from "../locale";
import { emptyProps } from "./common";
const __default__ = {
  options: {
    virtualHost: true,
    styleIsolation: "shared"
  }
};
export default /* @__PURE__ */ _defineComponent({
  ...__default__,
  __name: "empty",
  props: emptyProps,
  setup(__props, { expose: __expose }) {
    __expose();
    const { t } = useTranslate("empty");
    const props = __props;
    const bem = createBem("empty");
    const emptyClass = computed(() => {
      return classNames(bem.b(), props.rootClass);
    });
    const emptyStyle = computed(() => {
      return stringifyStyle(props.rootStyle);
    });
    const iconStyle = computed(() => {
      return stringifyStyle({
        fontSize: props.iconSize
      });
    });
    const __returned__ = { t, props, bem, emptyClass, emptyStyle, iconStyle, SarIcon };
    return __returned__;
  }
});
</script>

<style lang="scss">
@use './index.scss';
</style>