/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

import { getCurrentInstance, h, createVNode } from 'vue';
import isFunction from 'lodash/isFunction';

function useIcon() {
  var instance = getCurrentInstance();
  return function renderIconTNode(iconType, defaultIcons) {
    var iconContent;
    if (isFunction(instance.props[iconType])) {
      iconContent = instance.props[iconType](h);
    } else if (instance.slots[iconType]) {
      iconContent = instance.slots[iconType] && instance.slots[iconType](null)[0];
    } else if (defaultIcons) {
      var Component = defaultIcons[instance.props.theme];
      iconContent = createVNode(Component, null, null);
    }
    return iconContent;
  };
}

export { useIcon };
//# sourceMappingURL=icon.js.map
