mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 01:36:08 +08:00
20 lines
394 B
JavaScript
20 lines
394 B
JavaScript
import PropTypes from 'prop-types';
|
|
import classNames from 'classnames';
|
|
|
|
export default function IconComponent(props) {
|
|
const {
|
|
name,
|
|
className,
|
|
...rest
|
|
} = props;
|
|
const cn = classNames(className, `icon icon-${name}`);
|
|
return (
|
|
<span {...rest} className={cn} />
|
|
);
|
|
}
|
|
|
|
IconComponent.propTypes = {
|
|
name: PropTypes.string.isRequired,
|
|
className: PropTypes.string,
|
|
};
|