generated from MuhammadIqbalMaulana/UAS-SIG
Initial commit
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @license lucide v1.17.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import defaultAttributes from './defaultAttributes.mjs';
|
||||
|
||||
const createSVGElement = ([tag, attrs, children]) => {
|
||||
const element = document.createElementNS("http://www.w3.org/2000/svg", tag);
|
||||
Object.keys(attrs).forEach((name) => {
|
||||
element.setAttribute(name, String(attrs[name]));
|
||||
});
|
||||
if (children?.length) {
|
||||
children.forEach((child) => {
|
||||
const childElement = createSVGElement(child);
|
||||
element.appendChild(childElement);
|
||||
});
|
||||
}
|
||||
return element;
|
||||
};
|
||||
const createElement = (iconNode, customAttrs = {}) => {
|
||||
const tag = "svg";
|
||||
const attrs = {
|
||||
...defaultAttributes,
|
||||
...customAttrs
|
||||
};
|
||||
return createSVGElement([tag, attrs, iconNode]);
|
||||
};
|
||||
|
||||
export { createElement as default };
|
||||
//# sourceMappingURL=createElement.mjs.map
|
||||
Reference in New Issue
Block a user