icon-picker-react
Version:
Componente de seleção de ícones dinamicamente
13 lines (12 loc) • 500 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { createElement } from "react";
import { iconFaList } from "../../utils/FaIconsList";
import { Content } from "./style";
export default function Icon({ icon, size, color }) {
function findIcon() {
const iconSelected = iconFaList.find(i => i.label === icon);
return iconSelected ? iconSelected : iconFaList[0];
}
;
return (_jsx(Content, { size: size, color: color, children: createElement(findIcon().icon) }));
}