'use strict';

var _extends = require('./extends-29bdbc6d.js');
var React = require('react');
var YoutubeGroup = require('./YoutubeGroup.js');
require('./_commonjsHelpers-06173234.js');
require('./_to-object-6de10e57.js');
require('./_object-pie-083f2dd6.js');
require('./typeof-88a668c5.js');
require('./es6.string.iterator-c2573ffd.js');
require('./web.dom.iterable-46657b5c.js');
require('./_is-array-6128bd56.js');
require('./_library-dd23b178.js');
require('./slicedToArray-5d1bc3b3.js');
require('./core.get-iterator-method-f474eacc.js');
require('./index-187c967e.js');
require('./index-eadd5035.js');
require('react-dom');
require('prop-types');
require('./smoothscroll-99df7f93.js');
require('./index-efca863c.js');
require('./main-025fdc78.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;
