mirror of
https://github.com/flarum/framework.git
synced 2025-02-09 06:58:36 +08:00
13 lines
363 B
JavaScript
13 lines
363 B
JavaScript
/**
|
||
* The `icon` helper displays an icon.
|
||
*
|
||
* @param {String} fontClass The full icon class, prefix and the icon’s name.
|
||
* @param {Object} attrs Any other attributes to apply.
|
||
* @return {Object}
|
||
*/
|
||
export default function icon(fontClass, attrs = {}) {
|
||
attrs.className = 'icon ' + fontClass + ' ' + (attrs.className || '');
|
||
|
||
return <i {...attrs} />;
|
||
}
|