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

import { getCurrentInstance, h, createVNode } from 'vue';
import { i as isFunction_1 } from '../_chunks/dep-5717e263.mjs';
import '../_chunks/dep-eba0ea6e.mjs';
import '../_chunks/dep-469b4ae0.mjs';
import '../_chunks/dep-255303ba.mjs';
import '../_chunks/dep-a8bcacea.mjs';

function useIcon() {
  var instance = getCurrentInstance();
  return function renderIconTNode(iconType, defaultIcons) {
    var iconContent;
    if (isFunction_1(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.mjs.map
