2016-12-06 18:06:29 +01:00
|
|
|
import Telescope, { registerComponent } from 'meteor/nova:lib';
|
2016-11-24 15:47:51 +09:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
const Icon = ({ name, iconClass }) => {
|
|
|
|
const icons = Telescope.utils.icons;
|
|
|
|
const iconCode = !!icons[name] ? icons[name] : name;
|
|
|
|
iconClass = (typeof iconClass === 'string') ? ' '+iconClass : '';
|
|
|
|
const c = 'icon fa fa-fw fa-' + iconCode + ' icon-' + name + iconClass;
|
|
|
|
return <i className={c} aria-hidden="true"></i>;
|
|
|
|
}
|
|
|
|
|
|
|
|
Icon.displayName = "Icon";
|
|
|
|
|
2016-12-06 18:06:29 +01:00
|
|
|
registerComponent('Icon', Icon);
|
2016-11-26 11:17:01 +09:00
|
|
|
|
|
|
|
export default Icon;
|