summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/components/Icon.js
blob: fac446a0da4b0037c7dc7b41c97ded6634a65ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const React = require('react');

const Icon = React.createClass({
    propTypes: {
        id:        React.PropTypes.string,
        type:      React.PropTypes.string,
        className: React.PropTypes.string
    },

    getDefaultProps() {
        return {
            type: 'fa'
        };
    },

    render() {
        const { id, type } = this.props;
        let { className } = this.props;

        if (id) {
            className = type + ' ' + type + '-' + id;
        }

        return <i className={className}/>;
    }
});

module.exports = Icon;