import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import { computed, defineComponent, createVNode as _createVNode } from 'vue';
import classNames from '../_util/classNames';
import useConfigInject from '../config-provider/hooks/useConfigInject';
import omit from '../_util/omit';
import { skeletonElementProps } from './Element';
import useStyle from './style';
const SkeletonImage = defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: 'ASkeletonNode',
  inheritAttrs: false,
  props: omit(skeletonElementProps(), ['size', 'shape']),
  setup(props, {
    slots,
    attrs
  }) {
    const {
      prefixCls
    } = useConfigInject('skeleton', props);
    const [wrapSSR, hashId] = useStyle(prefixCls);
    const cls = computed(() => classNames(prefixCls.value, `${prefixCls.value}-element`, {
      [`${prefixCls.value}-active`]: props.active
    }, hashId.value, props.rootClassName));
    return () => {
      var _a;
      return wrapSSR(_createVNode("div", {
        "class": cls.value
      }, [_createVNode("div", _objectSpread({
        "class": `${prefixCls.value}-image`
      }, attrs), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])]));
    };
  }
});
export default SkeletonImage;