'use strict';

require('./_commonjsHelpers-06173234.js');
var React = require('react');
require('prop-types');
require('react-dom');
require('./index-b5eb3ff8.js');
var urlFor = require('./urlFor.js');
var index = require('./index-9d365128.js');
var entities = require('./entities-310b46ee.js');
var Media = require('react-bootstrap/Media');

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;
