2017-12-24 07:16:45 +01:00
|
|
|
import React from 'react';
|
2019-09-09 15:28:45 +02:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import classNames from 'classnames';
|
2017-12-24 07:16:45 +01:00
|
|
|
|
2019-09-09 15:28:45 +02:00
|
|
|
export default class Icon extends React.PureComponent {
|
2017-12-24 07:16:45 +01:00
|
|
|
|
2019-09-09 15:28:45 +02:00
|
|
|
static propTypes = {
|
|
|
|
id: PropTypes.string.isRequired,
|
|
|
|
className: PropTypes.string,
|
|
|
|
fixedWidth: PropTypes.bool,
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const { id, className, fixedWidth, ...other } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<i role='img' className={classNames('fa', `fa-${id}`, className, { 'fa-fw': fixedWidth })} {...other} />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|