import { forwardRef, createElement } from 'react';
import { mergeClasses, toKebabCase, toPascalCase } from '@opudoc/opicon-shared';
import Icon from './Icon.mjs';

const createOpiconIcon = (iconName, iconNode) => {
  const Component = forwardRef(
    ({ className, ...props }, ref) => createElement(Icon, {
      ref,
      iconNode,
      className: mergeClasses(`opicon-${toKebabCase(toPascalCase(iconName))}`, `opicon-${iconName}`, className),
      ...props
    })
  );
  Component.displayName = toPascalCase(iconName);
  return Component;
};

export { createOpiconIcon as default };
//# sourceMappingURL=createOpiconIcon.mjs.map
