'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);

require('./index.less');

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

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

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

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

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

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