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, { Fragment } from 'react';
import Rotation from '../rotation/index';
import './index.less';

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

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

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

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

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

    return UmBanner;
}(React.Component);

export default UmBanner;