import _extends from "babel-runtime/helpers/extends";
import _classCallCheck from "babel-runtime/helpers/classCallCheck";
import _createClass from "babel-runtime/helpers/createClass";
import _possibleConstructorReturn from "babel-runtime/helpers/possibleConstructorReturn";
import _inherits from "babel-runtime/helpers/inherits";
import React, { Component } from "react";
import AntdIcon from "antd/es/icon";
import PagePoint from "../page-point/pagePointEnhanced";
import { ConfigConsumer } from "../config-provider";
import "antd/es/icon/style";
var createFromIconfontCN = AntdIcon.createFromIconfontCN,
    getTwoToneColor = AntdIcon.getTwoToneColor,
    setTwoToneColor = AntdIcon.setTwoToneColor;

var Icon = function (_Component) {
    _inherits(Icon, _Component);

    function Icon() {
        _classCallCheck(this, Icon);

        return _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).apply(this, arguments));
    }

    _createClass(Icon, [{
        key: "render",
        value: function render() {
            var _this2 = this;

            return React.createElement(
                ConfigConsumer,
                null,
                function (_ref) {
                    var pagePoint = _ref.pagePoint;
                    return pagePoint ? React.createElement(PagePoint, _extends({ compType: "Icon" }, _this2.props, { render: function render(eventprops) {
                            return React.createElement(AntdIcon, _extends({}, _this2.props, eventprops));
                        } })) : React.createElement(AntdIcon, _this2.props);
                }
            );
        }
    }]);

    return Icon;
}(Component);

export default Icon;

Icon.createFromIconfontCN = createFromIconfontCN;
Icon.getTwoToneColor = getTwoToneColor;
Icon.setTwoToneColor = setTwoToneColor;