mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 20:10:58 +00:00
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
/**
|
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
*
|
|
* This source code is licensed under the MIT license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
import { forwardRef, createElement } from 'react';
|
|
import defaultAttributes from './defaultAttributes.mjs';
|
|
|
|
const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
const Component = forwardRef(
|
|
({ color = "currentColor", size = 24, stroke = 2, title, className, children, ...rest }, ref) => createElement(
|
|
"svg",
|
|
{
|
|
ref,
|
|
...defaultAttributes[type],
|
|
width: size,
|
|
height: size,
|
|
className: [`tabler-icon`, `tabler-icon-${iconName}`, className].join(" "),
|
|
...type === "filled" ? {
|
|
fill: color
|
|
} : {
|
|
strokeWidth: stroke,
|
|
stroke: color
|
|
},
|
|
...rest
|
|
},
|
|
[
|
|
title && createElement("title", { key: "svg-title" }, title),
|
|
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
...Array.isArray(children) ? children : [children]
|
|
]
|
|
)
|
|
);
|
|
Component.displayName = `${iconNamePascal}`;
|
|
return Component;
|
|
};
|
|
|
|
export { createReactComponent as default };
|
|
//# sourceMappingURL=createReactComponent.mjs.map
|