1
0
mirror of https://github.com/yldio/copilot.git synced 2024-09-22 14:23:50 +03:00
copilot/ui/src/components/icon/index.js
Sérgio Ramos 5a6a7ae53b convert Icon
2016-12-12 10:28:48 +00:00

35 lines
633 B
JavaScript

const React = require('react');
const Styled = require('styled-components');
const {
default: styled,
css
} = Styled;
const styles = css`
font-size: inherit;
`;
const Icon = ({
name = 'beer',
className,
iconSet = 'fa',
style
}) => {
const Icon = require(`react-icons/lib/${iconSet}/${name}`);
const Component = styled(Icon)(styles);
return (
<Component className={className} style={style} />
);
};
Icon.propTypes = {
className: React.PropTypes.string,
iconSet: React.PropTypes.string.isRequired,
name: React.PropTypes.string.isRequired,
style: React.PropTypes.object
};
module.exports = Icon;