bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/common/icon/component.jsx

32 lines
672 B
React
Raw Normal View History

import React, { memo } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import _ from 'lodash';
const propTypes = {
iconName: PropTypes.string.isRequired,
prependIconName: PropTypes.string,
};
const defaultProps = {
prependIconName: 'icon-bbb-',
};
const Icon = ({
className,
prependIconName,
iconName,
...props
}) => (
2017-10-11 06:08:51 +08:00
<i
className={cx(className, [prependIconName, iconName].join(''))}
// ToastContainer from react-toastify passes a useless closeToast prop here
2021-11-11 21:36:00 +08:00
{..._.omit(props, ['closeToast', 'animations'])}
2017-10-11 06:08:51 +08:00
/>
);
2017-10-23 20:25:05 +08:00
export default memo(Icon);
Icon.propTypes = propTypes;
Icon.defaultProps = defaultProps;