UNPKG

472 BJavaScriptView Raw
1import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2import * as React from 'react';
3export default function Icon(_ref) {
4 var icon = _ref.icon,
5 props = _ref.props,
6 children = _ref.children;
7 var iconNode;
8
9 if (typeof icon === 'function') {
10 iconNode = /*#__PURE__*/React.createElement(icon, _objectSpread({}, props));
11 } else {
12 // Compatible for origin definition
13 iconNode = icon;
14 }
15
16 return iconNode || children || null;
17}
\No newline at end of file