mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00
16 lines
No EOL
519 B
JavaScript
16 lines
No EOL
519 B
JavaScript
import { registerComponent, Utils } from 'meteor/vulcan:lib';
|
|
import React from 'react';
|
|
|
|
const Icon = ({ name, iconClass, onClick }) => {
|
|
const icons = 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 onClick={onClick} className={c} aria-hidden="true"></i>;
|
|
}
|
|
|
|
Icon.displayName = 'Icon';
|
|
|
|
registerComponent('Icon', Icon);
|
|
|
|
export default Icon; |