'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 _index = require('../rotation/index');

var _index2 = _interopRequireDefault(_index);

require('./index.less');

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

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

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

    (0, _createClass3['default'])(UmBanner, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                _props$imgList = _props.imgList,
                imgList = _props$imgList === undefined ? [] : _props$imgList,
                speed = _props.speed;

            return _react2['default'].createElement(
                _react.Fragment,
                null,
                _react2['default'].createElement(
                    'div',
                    { className: 'offerCarouselRow' },
                    _react2['default'].createElement(
                        _index2['default'],
                        { autoplay: true, autoplaySpeed: speed || 3000 },
                        imgList && imgList.length && imgList.map(function (v, i) {
                            return _react2['default'].createElement(
                                'a',
                                { href: v.link, key: 'carouselItem' + i },
                                _react2['default'].createElement('div', { className: 'carouselItem carouselItem1', style: { backgroundImage: 'url(' + v.imgUrl + ')' } })
                            );
                        })
                    )
                )
            );
        }
    }]);
    return UmBanner;
}(_react2['default'].Component);

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