diff --git a/src/lib/components/atoms/Icon.js b/src/lib/components/atoms/Icon.js index 20907d920c7d531ebf941ed2d2ccf836b13de265..0f91fd565ebbf63f7feea2374d4ee090ae948854 100644 --- a/src/lib/components/atoms/Icon.js +++ b/src/lib/components/atoms/Icon.js @@ -11,15 +11,18 @@ import { unit } from '../../utils' * do a barrel roll * ` */ -const Icon = ({ icon: Icon, alt, size, ...props }) => ( - <Icon - style={{ width: unit(size || 4) }} - role={'img'} - aria-label={alt} - alt={alt} - {...props} - /> -) +const Icon = ({ icon: Icon, alt, size, ...props }) => + Icon ? ( + <Icon + style={{ width: unit(size || 4) }} + role={'img'} + aria-label={alt} + alt={alt} + {...props} + /> + ) : ( + alt || 'Empty icon' + ) Icon.propTypes = { icon: PropTypes.func.isRequired,