import { _ as _typeof } from './typeof-e9fc0c5d.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 'prop-types';
import './_commonjsHelpers-0c4b6f40.js';
import './core.get-iterator-method-ea258bb1.js';
import './web.dom.iterable-ab4dea5c.js';
import './_is-array-8d21b9e3.js';
import './_object-pie-133f504a.js';
import './_library-528f1934.js';
import 'react-dom';
import './slicedToArray-6ebcbfea.js';
import './index-3f5c03b2.js';

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

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

  var episode = parseInt(index) + 1;

  return React__default.createElement(
    'div',
    { className: styles.article },
    React__default.createElement(
      'a',
      { href: '/view/' + data.url.current, style: variant === 'right' ? { flexDirection: 'row-reverse' } : {} },
      React__default.createElement(
        'div',
        { className: styles.thumb },
        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: styles.info, style: variant === 'right' ? { padding: '0 1rem 0 0' } : { padding: ' 0 0 0 1rem' } },
        React__default.createElement(
          'div',
          { style: { fontSize: '1.3rem', fontWeight: 'bold' } },
          episode && 'EP ' + episode + ': ',
          data.title
        ),
        data.published && React__default.createElement(
          'p',
          { className: styles.published },
          moment(data.published).format('MMMM Do YYYY')
        ),
        data.authorMapping && data.authorMapping.displayName && React__default.createElement(
          'p',
          { className: styles.author },
          'By ',
          React__default.createElement(
            'span',
            null,
            data.authorMapping.displayName
          )
        ),
        data.intro && React__default.createElement('p', { dangerouslySetInnerHTML: { __html: data.intro }, className: styles.summary })
      )
    )
  );
};

export default VideoSeriesCard;
