2015-07-15 12:30:11 +08:00
|
|
|
|
/**
|
2018-02-24 06:42:00 +08:00
|
|
|
|
* The `icon` helper displays an icon.
|
2015-07-15 12:30:11 +08:00
|
|
|
|
*
|
2018-02-24 06:42:00 +08:00
|
|
|
|
* @param {String} fontClass The full icon class, prefix and the icon’s name.
|
2015-07-15 12:30:11 +08:00
|
|
|
|
* @param {Object} attrs Any other attributes to apply.
|
|
|
|
|
* @return {Object}
|
|
|
|
|
*/
|
2018-02-24 06:42:00 +08:00
|
|
|
|
export default function icon(fontClass, attrs = {}) {
|
|
|
|
|
attrs.className = 'icon ' + fontClass + ' ' + (attrs.className || '');
|
2015-07-15 12:30:11 +08:00
|
|
|
|
|
2020-04-17 17:57:55 +08:00
|
|
|
|
return <i {...attrs} />;
|
2015-04-25 20:58:39 +08:00
|
|
|
|
}
|