import React from 'react';
var RateItem = function (props) {
    var half = props.half, color = props.color, value = props.value, character = props.character, prefixCls = props.prefixCls, index = props.index, onMouseEnter = props.onMouseEnter, onClick = props.onClick;
    var getColor = function (curr, max) {
        var val = half ? curr : Math.round(curr);
        return val <= max ? color : '#e8e8e8';
    };
    return (React.createElement("li", { className: prefixCls + "__item", onClick: onClick },
        React.createElement("div", { style: { color: getColor(index - 0.5, value) }, className: prefixCls + "__item-first", onMouseEnter: function () { return onMouseEnter(index - 0.5); } }, character),
        React.createElement("div", { style: { color: getColor(index, value) }, className: prefixCls + "__item-second", onMouseEnter: function () { return onMouseEnter(index); } }, character)));
};
RateItem.displayName = 'RateItem';
export default RateItem;
//# sourceMappingURL=rate-item.js.map