'use strict';

var _extends = require('./extends-7c86182f.js');
var React = require('react');
var YoutubeGroup = require('./YoutubeGroup.js');
require('./_commonjsHelpers-06173234.js');
require('./core.get-iterator-method-5643aa10.js');
require('./_object-pie-083f2dd6.js');
require('./slicedToArray-067dd3bc.js');
require('./web.dom.iterable-d98303e0.js');
require('./index-187c967e.js');
require('./index-65621b6c.js');
require('react-dom');
require('prop-types');
require('./smoothscroll-99df7f93.js');
require('./urlFor.js');
require('./index-d48b231c.js');
require('./main-6054981e.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

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["default"].createElement(
    React__default["default"].Fragment,
    null,
    articles ? React__default["default"].createElement(YoutubeGroup, _extends._extends({ key: 'articleCarousel-0', dataset: data }, props)) : React__default["default"].createElement(
      'p',
      null,
      'No Article Found.'
    )
  );
}

module.exports = ArticleCarousel;
