import React from 'react'; import PropTypes from 'prop-types'; import iconMap from './utils/iconMap.js'; const SVGIcon = ({name, onClick, label, className, iconClassName, labelClassName, labelPosition, color, disabled, ...other}) => { let colorClass = (color !== '') ? '__' + color : ''; let classes = `svg-icon-wrapper ${iconClassName} ${className} ${colorClass} ${onClick ? 'clickable' : ''} ${labelPosition}`; let camelCasedName = name.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); let IconComponent = iconMap[camelCasedName]; if (!IconComponent) { console.error('Icon by the name ' + camelCasedName + ' is missing.'); } return (