1 | const React = require('react');
|
2 |
|
3 | /**
|
4 | * Icon
|
5 | * @property {String} name the icon class to use
|
6 | */
|
7 | class Icon extends React.Component {
|
8 | static displayName = "Icon"
|
9 |
|
10 | static propTypes = {
|
11 | name: React.PropTypes.string.isRequired
|
12 | }
|
13 |
|
14 | render() {
|
15 | const {name='pizza', className='', ...props} = this.props;
|
16 | return (
|
17 | <span
|
18 | aria-hidden='true'
|
19 | className={`tui-icon icon-${name} ${className}`}
|
20 | {...props}
|
21 | />
|
22 | )
|
23 | }
|
24 | }
|
25 |
|
26 | module.exports = {Icon};
|