ps-frame-father
Version:
An enterprise-class UI design language and React components implementation
32 lines (30 loc) • 749 B
JavaScript
import React from "react";
import PropTypes from 'prop-types';
import * as Fa from 'react-icons/fa';
import "./index.css";
/**
* Icon Icon组件
* @param {type} string icon类型
* @param {size} string icon大小 px|lg|xs
* @param {rotation} number 选转角度
* @param {style} object 图标样式
*/
function Icon(props) {
var type = props.type,
size = props.size,
rotation = props.rotation,
style = props.style;
var IconComponent = Fa[type];
return /*#__PURE__*/React.createElement(IconComponent, {
size: size,
rotation: rotation,
style: style
});
}
Icon.propTypes = {
type: PropTypes.string,
size: PropTypes.string,
rotation: PropTypes.number,
style: PropTypes.object
};
export default Icon;