import { _ as _typeof } from './typeof-657f25da.js';
import React__default from 'react';
import { L as LazyLoad } from './index-755f2cc2.js';
import urlFor from './urlFor.js';
import { m as moment } from './moment-bc12cb97.js';
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
import { B as BlockContent } from './BlockContent-1e73bd2c.js';
import { g as getSerializers } from './index-1f0f9b26.js';

var css = ".MediaSeriesCard-module_article__SAFYK {\r\n  width: 100%;\r\n  margin: 0 0 1rem 0;\r\n}\r\n.MediaSeriesCard-module_article__SAFYK a {\r\n  display: flex;\r\n  width: 100%;\r\n  color: #000000;\r\n}\r\n.MediaSeriesCard-module_thumb__3jRAU {\r\n  width: 25%;\r\n}\r\n.MediaSeriesCard-module_thumb__3jRAU img {\r\n  width: 100%;\r\n  height: auto;\r\n}\r\n.MediaSeriesCard-module_info__3L7_o {\r\n  width: 75%;\r\n  font-size: 1rem;\r\n}\r\n.MediaSeriesCard-module_info__3L7_o h2 {\r\n  font-weight: bold;\r\n  font-size: 1.25rem;\r\n  margin: 0;\r\n}\r\n.MediaSeriesCard-module_published__E4oiz {\r\n  color: #6d6d6d;\r\n  margin: 0;\r\n}\r\n.MediaSeriesCard-module_summary__1xanh {\r\n  margin: 0.5rem 0 0 0;\r\n}\r\n.MediaSeriesCard-module_author__e5fuR {\r\n  margin: 0;\r\n}\r\n.MediaSeriesCard-module_author__e5fuR span {\r\n  color: #6d6d6d;\r\n}\r\n.MediaSeriesCard-module_name__2m5KY {\r\n  font-size: 1.3rem;\r\n  font-weight: bold;\r\n}\r\n@media only screen and (max-width: 568px) {\r\n  .MediaSeriesCard-module_article__SAFYK {\r\n    margin: 1rem 0;\r\n    box-shadow: 2px 4px 8px rgba(0,0,0,.2);\r\n  }\r\n  .MediaSeriesCard-module_article__SAFYK a {\r\n    flex-direction: column;\r\n    align-items: center;\r\n  }\r\n  .MediaSeriesCard-module_thumb__3jRAU {\r\n    overflow: hidden;\r\n    width: 100%;\r\n    margin-bottom: 1rem;\r\n  }\r\n  .MediaSeriesCard-module_thumb__3jRAU img{\r\n    border-radius: 10px 10px 0 0;    \r\n  }\r\n  .MediaSeriesCard-module_thumb__3jRAU figure {\r\n    margin: 0;\r\n  }\r\n  .MediaSeriesCard-module_info__3L7_o {\r\n    width: 90%;\r\n    padding: 0rem !important;\r\n  }\r\n  .MediaSeriesCard-module_info__3L7_o h2 {\r\n    font-size: 1rem;\r\n  }\r\n  .MediaSeriesCard-module_name__2m5KY {\r\n    font-size: 1rem;\r\n    \r\n  }\r\n}\r\n";
var styles = { "article": "MediaSeriesCard-module_article__SAFYK", "thumb": "MediaSeriesCard-module_thumb__3jRAU", "info": "MediaSeriesCard-module_info__3L7_o", "published": "MediaSeriesCard-module_published__E4oiz", "summary": "MediaSeriesCard-module_summary__1xanh", "author": "MediaSeriesCard-module_author__e5fuR", "name": "MediaSeriesCard-module_name__2m5KY" };
styleInject(css);

var MediaSeriesCard = function MediaSeriesCard(props) {
  var data = props.data,
      variant = props.variant,
      defaultImage = props.defaultImage,
      client = props.client;


  return React__default.createElement(
    'div',
    { className: 'media-series-article ' + styles.article },
    React__default.createElement(
      'a',
      { href: '/' + data.parentUrl + '/' + data.identifier.current, style: variant === 'right' ? { flexDirection: 'row-reverse' } : {} },
      React__default.createElement(
        'div',
        { className: 'media-series-thumbnail ' + styles.thumb },
        data.thumbnail && data.thumbnail.asset && React__default.createElement(
          'figure',
          null,
          React__default.createElement(
            LazyLoad,
            null,
            React__default.createElement('img', {
              src: data.thumbnail && data.thumbnail.asset ? urlFor({ client: client, source: data.thumbnail }) : data.thumbnail && _typeof(data.thumbnail == 'string') ? data.thumbnail : defaultImage
            })
          )
        )
      ),
      React__default.createElement(
        'div',
        { className: 'media-series-info ' + styles.info, style: variant === 'right' ? { padding: '0 1rem 0 0' } : { padding: ' 0 0 0 1rem' } },
        React__default.createElement(
          'div',
          { className: 'media-series-name ' + styles.name },
          data.name
        ),
        data.published && React__default.createElement(
          'p',
          { className: 'media-series-published ' + styles.published },
          moment(data.published).format('MMMM Do YYYY')
        ),
        data.authorMapping && data.authorMapping.displayName && React__default.createElement(
          'p',
          { className: 'media-series-author ' + styles.author },
          'By ',
          React__default.createElement(
            'span',
            null,
            data.authorMapping.displayName
          )
        ),
        data.description && React__default.createElement(
          'div',
          { className: 'media-series-desc' },
          React__default.createElement(BlockContent, { blocks: data.description, serializers: getSerializers(client) })
        )
      )
    )
  );
};

export { MediaSeriesCard as M };
