'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

require('./_commonjsHelpers-06173234.js');
require('./core.get-iterator-method-f3c44602.js');
require('./_object-pie-68c5bcbc.js');
var _extends = require('./extends-eed4f016.js');
require('./web.dom.iterable-e34bf324.js');
var React = require('react');
var React__default = _interopDefault(React);
require('prop-types');
require('react-dom');
require('./slicedToArray-f6d4eaa8.js');
require('./index-be0c82be.js');
require('./urlFor.js');
require('./index-96b3db50.js');
require('./main-02daeefe.js');
require('./index-187c967e.js');
require('./smoothscroll-5054361f.js');
var YoutubeGroup = require('./YoutubeGroup.js');

function ArticleCarousel(props) {
  //Passed in array of articles to pass into YoutubeGroup
  var articles = props.articles;

  //Setup article.link URL

  var data = articles.map(function (article, index) {
    article.link = '/view/' + article.url.current;
    return article;
  });

  return React__default.createElement(
    React__default.Fragment,
    null,
    articles ? React__default.createElement(YoutubeGroup, _extends._extends({ key: 'articleCarousel-0', dataset: data }, props)) : React__default.createElement(
      'p',
      null,
      'No Article Found.'
    )
  );
}

module.exports = ArticleCarousel;
