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 './index.less';

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

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

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

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

      return React.createElement(
        'div',
        { className: 'special-offer-box', onClick: function onClick() {
            return clickToDetail();
          } },
        React.createElement(
          'div',
          { className: 'special-offer-warp' },
          React.createElement('img', { className: 'special-offer-img', src: data && data.offerImgUrl }),
          React.createElement(
            'div',
            { className: 'special-offer-description' },
            data && data.offerName
          ),
          React.createElement(
            'div',
            { className: 'special-offer-layout' },
            React.createElement(
              'div',
              { className: 'special-offer-price' },
              data && data.currencySymbol,
              data && data.specialPriceStr
            ),
            state && React.createElement(
              'div',
              { className: 'special-offer-tag' },
              data && data.discountPercent,
              '% off'
            )
          ),
          React.createElement(
            'div',
            { className: 'special-offer-costn' },
            data && data.salesPrice
          )
        ),
        React.createElement(
          'div',
          { className: 'special-offer-sold' },
          React.createElement(
            'div',
            { className: 'left-box' },
            React.createElement(
              'p',
              null,
              data && state ? data.salePercent : '0',
              '% Sold'
            ),
            React.createElement(
              'div',
              { className: 'schedule-box' },
              state && React.createElement('div', { className: 'schedule', style: { width: data.salePercent + '%' } })
            )
          ),
          React.createElement(
            'div',
            { className: 'right-box ' + (state ? '' : 'comingSoon') },
            state ? 'Buy Now' : 'Coming Soon'
          )
        )
      );
    }
  }]);

  return SpecialOfferItem;
}(React.Component);

export default SpecialOfferItem;