UNPKG

undraw-react

Version:
16 lines 598 B
import React from "react"; import * as Ills from './illustrations'; export const UndrawIllustration = ({ name, color, size, style, }) => { // Find the matching component based on the name prop const getComponentByName = (name) => { const Component = Ills[name]; if (Component) { return React.createElement(Component, { color: color, size: size, style: style }); } else { return React.createElement("span", null, "Undraw not found."); } }; return getComponentByName(name); }; //# sourceMappingURL=UndrawComponent.js.map