Icon.js 516 Bytes
import  * as iconsSvg from "@ant-design/icons-svg";
import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";

class Icon {
    props = {
        type: String,
    };

    constructor() {
        $element.replaceWith(
            renderIconDefinitionToSVGElement(iconsSvg[this.props.type], {
                extraSVGAttrs: {
                    width: "1em",
                    height: "1em",
                    fill: "currentColor",
                },
            })
        );
    }
}