'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _fdx = require('@whalecloud/fdx');

var _commodityTags = require('../commodity-tags');

var _commodityTags2 = _interopRequireDefault(_commodityTags);

var _commodityStar = require('../commodity-star');

var _commodityStar2 = _interopRequireDefault(_commodityStar);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var CommodityInfo = function (_React$Component) {
    (0, _inherits3['default'])(CommodityInfo, _React$Component);

    function CommodityInfo() {
        (0, _classCallCheck3['default'])(this, CommodityInfo);
        return (0, _possibleConstructorReturn3['default'])(this, (CommodityInfo.__proto__ || Object.getPrototypeOf(CommodityInfo)).apply(this, arguments));
    }

    (0, _createClass3['default'])(CommodityInfo, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                data = _props.data,
                sku = _props.sku,
                _onRateClick = _props.onRateClick,
                onTitleClick = _props.onTitleClick,
                onStoreClick = _props.onStoreClick;

            return _react2['default'].createElement(
                'div',
                { className: 'commodity-info-wrap' },
                _react2['default'].createElement(
                    _fdx.Row,
                    { className: 'commodity-info-row', type: 'flex', justify: 'space-between' },
                    _react2['default'].createElement(
                        _fdx.Col,
                        { span: 24, className: 'info-price' },
                        sku && sku.price
                    ),
                    _react2['default'].createElement(
                        _fdx.Col,
                        { span: 24, className: 'info-title' },
                        _react2['default'].createElement(
                            'span',
                            { onClick: function onClick() {
                                    return onTitleClick && onTitleClick();
                                } },
                            data && data.title
                        )
                    ),
                    _react2['default'].createElement(
                        _fdx.Col,
                        { span: 12, className: 'info-stars' },
                        _react2['default'].createElement(_commodityStar2['default'], { data: data && data.stars, onRateClick: function onRateClick() {
                                return _onRateClick && _onRateClick();
                            } })
                    ),
                    _react2['default'].createElement(
                        _fdx.Col,
                        { span: 12, className: 'info-purchased' },
                        data && data.purchased,
                        '+ Purchased'
                    ),
                    _react2['default'].createElement(
                        _fdx.Col,
                        { span: 24, className: 'info-store' },
                        _react2['default'].createElement(
                            'a',
                            { onClick: function onClick() {
                                    return onStoreClick && onStoreClick();
                                } },
                            data && data.store
                        )
                    ),
                    _react2['default'].createElement(
                        _fdx.Col,
                        { span: 24 },
                        _react2['default'].createElement(_commodityTags2['default'], { data: data && data.tags })
                    )
                )
            );
        }
    }]);
    return CommodityInfo;
}(_react2['default'].Component);

exports['default'] = CommodityInfo;
module.exports = exports['default'];