'use strict';

var React = require('react');
var Media = require('react-bootstrap/Media');
var urlFor = require('./urlFor.js');
var index = require('./index-eadd5035.js');
var entities = require('./entities-df1aed86.js');
require('./slicedToArray-067dd3bc.js');
require('./_commonjsHelpers-06173234.js');
require('./web.dom.iterable-d98303e0.js');
require('./core.get-iterator-method-5643aa10.js');
require('./extends-be0d85bc.js');
require('./index-d48b231c.js');
require('react-dom');
require('prop-types');

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

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

var ThumbnailCard = function ThumbnailCard(_ref) {
  var size = _ref.size,
      mediaData = _ref.mediaData,
      client = _ref.client,
      defaultImage = _ref.defaultImage;


  return React__default['default'].createElement(
    'div',
    null,
    mediaData && mediaData.map(function (item, index$1) {
      return React__default['default'].createElement(
        Media__default['default'],
        { className: 'mb-3 thumbnail-card' },
        React__default['default'].createElement(
          index.LazyLoad,
          { height: size },
          React__default['default'].createElement('img', { width: size, height: size, className: 'mr-3', src: item.thumbnail ? urlFor({ client: client, source: item.thumbnail }) : defaultImage, alt: 'Generic placeholder' })
        ),
        React__default['default'].createElement(
          Media__default['default'].Body,
          null,
          React__default['default'].createElement(
            'h5',
            null,
            item.title
          ),
          React__default['default'].createElement(
            'p',
            null,
            entities.clean_html_1(item.summary)
          )
        )
      );
    })
  );
};

module.exports = ThumbnailCard;
