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

import { getCurrentInstance, h, createVNode } from 'vue';
import { i as isFunction_1 } from '../_chunks/dep-6b22dd27.mjs';
import '../_chunks/dep-a0b4a044.mjs';
import '../_chunks/dep-c959a6fb.mjs';
import '../_chunks/dep-b4041200.mjs';
import '../_chunks/dep-0f0c89ff.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
