summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/components/Icon.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gitbook-core/src/components/Icon.js')
-rw-r--r--packages/gitbook-core/src/components/Icon.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/gitbook-core/src/components/Icon.js b/packages/gitbook-core/src/components/Icon.js
new file mode 100644
index 0000000..fac446a
--- /dev/null
+++ b/packages/gitbook-core/src/components/Icon.js
@@ -0,0 +1,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;