import { createVNode as _createVNode } from "vue";
import { defineComponent } from 'vue';
import Tooltip from '../tooltip';
import tooltipProps from '../tooltip/tooltipProps';
import { getComponent } from '../_util/props-util';
export default defineComponent({
  name: 'x-popover',
  props: { ...tooltipProps,
    prefixCls: {
      default: 'x-popover'
    },
    content: String
  },

  setup(props, {
    attrs,
    slots
  }) {
    const {
      prefixCls
    } = props;
    return self => {
      var _slots$default;

      const title = getComponent(self, 'title');
      const content = getComponent(self, 'content');
      const tooltipProps = { ...props,
        ...attrs,
        title: _createVNode("div", null, [title && _createVNode("div", {
          "class": `${prefixCls}-title`
        }, [title]), _createVNode("div", {
          "class": `${prefixCls}-content`
        }, [content])])
      };
      return _createVNode(Tooltip, tooltipProps, {
        default: () => [(_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]
      });
    };
  }

});