import './_commonjsHelpers-0c4b6f40.js';
import React__default from 'react';
import 'prop-types';
import 'react-dom';
import { i as imageUrlBuilder } from './index-73819142.js';
import { L as LazyLoad } from './index-5f9f807a.js';
import { c as clean_html_1 } from './entities-7cc3bf45.js';
import Media from 'react-bootstrap/Media';

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

  var builder = imageUrlBuilder(client);

  var urlFor = function urlFor(source) {
    return builder.image(source).auto('format');
  };

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

export default ThumbnailCard;
