import { __assign, __rest } from "tslib";
import React, { useContext } from 'react';
import classNames from 'classnames';
import { ConfigContext } from '../config-provider/config-context';
import { getPrefixCls } from '../_utils/general';
var Icon = function (props) {
    var _a;
    var name = props.name, color = props.color, size = props.size, style = props.style, spin = props.spin, className = props.className, customisedCls = props.prefixCls, otherProps = __rest(props, ["name", "color", "size", "style", "spin", "className", "prefixCls"]);
    var configContext = useContext(ConfigContext);
    var prefixCls = getPrefixCls('icon', configContext.prefixCls, customisedCls);
    var cls = classNames(prefixCls, className, "ty--" + name, (_a = {},
        _a[prefixCls + "_spin"] = spin,
        _a));
    return React.createElement("i", __assign({ className: cls, style: __assign({ color: color, fontSize: size }, style) }, otherProps));
};
Icon.displayName = 'Icon';
export default Icon;
//# sourceMappingURL=index.js.map