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 from 'react';
import { Rate } from '@whalecloud/fdx';

var CommodityStar = function (_React$Component) {
    _inherits(CommodityStar, _React$Component);

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

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

    _createClass(CommodityStar, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                data = _props.data,
                onRateClick = _props.onRateClick;

            return React.createElement(
                'div',
                { className: 'commodity-star-wrap', onClick: function onClick() {
                        return onRateClick && onRateClick();
                    } },
                React.createElement(Rate, { allowHalf: true, defaultValue: data, style: { fontSize: 12 }, disabled: true })
            );
        }
    }]);

    return CommodityStar;
}(React.Component);

export default CommodityStar;