import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, createBlock, toDisplayString, createCommentVNode } from 'vue';
import getPrefixCls from '../_util/getPrefixCls';
import { useTheme } from '../_theme/useTheme';
import { useLocale } from '../config-provider/useLocale';
import DefaultImgEmpty from './imgEmpty.js';
import { emptyProps } from './props';

var script = defineComponent({
  name: 'FEmpty',
  components: {
    DefaultImgEmpty
  },
  props: emptyProps,
  setup() {
    useTheme();
    const prefixCls = getPrefixCls('empty');
    const {
      t
    } = useLocale();
    const defaultDescription = computed(() => t('empty.emptyText'));
    return {
      prefixCls,
      defaultDescription
    };
  }
});

const _hoisted_1 = ["src"];
const _hoisted_2 = {
  key: 1
};
const _hoisted_3 = {
  key: 2
};
function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_DefaultImgEmpty = resolveComponent("DefaultImgEmpty");
  return openBlock(), createElementBlock("div", {
    class: normalizeClass(_ctx.prefixCls)
  }, [createElementVNode("div", {
    class: normalizeClass(`${_ctx.prefixCls}-image`),
    style: normalizeStyle(_ctx.imageStyle)
  }, [_ctx.$slots.image ? renderSlot(_ctx.$slots, "image", {
    key: 0
  }) : _ctx.imageSrc ? (openBlock(), createElementBlock("img", {
    key: 1,
    class: "empty-img",
    src: _ctx.imageSrc,
    ondragstart: "return false"
  }, null, 8 /* PROPS */, _hoisted_1)) : (openBlock(), createBlock(_component_DefaultImgEmpty, {
    key: 2
  }))], 6 /* CLASS, STYLE */), createElementVNode("div", {
    class: normalizeClass(`${_ctx.prefixCls}-description`)
  }, [_ctx.$slots.description ? renderSlot(_ctx.$slots, "description", {
    key: 0
  }) : _ctx.description ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(_ctx.description), 1 /* TEXT */)) : (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(_ctx.defaultDescription), 1 /* TEXT */))], 2 /* CLASS */), _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
    key: 0,
    class: normalizeClass(`${_ctx.prefixCls}-bottom`)
  }, [renderSlot(_ctx.$slots, "default")], 2 /* CLASS */)) : createCommentVNode("v-if", true)], 2 /* CLASS */);
}

script.render = render;
script.__file = "components/empty/empty.vue";

export { script as default };
