import React from 'react'; import PropTypes from 'prop-types'; import {values} from 'lodash'; import {OverlayTrigger, Tooltip} from 'react-bootstrap'; import classNames from 'classnames'; import {ICON_COLORS} from './constants'; import Icon from './Icon'; /** * @ngdoc react * @name IconMix * @description Mixing two icons */ const IconMix: React.StatelessComponent = ({icon, subIcon, big, doubleSize, className, tooltip, color}) => { let iconElement; if (subIcon) { if (big) { iconElement = ( ); } else if (doubleSize) { iconElement = ( ); } else { iconElement = ( ); } } else if (big) { iconElement = (
); } else { iconElement = ( ); } return tooltip ? ( {tooltip} } > {iconElement} ) : iconElement; }; IconMix.propTypes = { icon: PropTypes.string, subIcon: PropTypes.string, big: PropTypes.bool, doubleSize: PropTypes.bool, className: PropTypes.string, tooltip: PropTypes.string, color: PropTypes.oneOf(values(ICON_COLORS)), }; IconMix.defaultProps = { big: false, doubleSize: false, }; export default IconMix;