import React__default from 'react';
import { m as moment } from './moment-bc12cb97.js';
import urlFor from './urlFor.js';
import './_commonjsHelpers-0c4b6f40.js';
import './slicedToArray-6ebcbfea.js';
import './web.dom.iterable-ab4dea5c.js';
import './core.get-iterator-method-ea258bb1.js';
import './extends-1559c147.js';
import './index-3f5c03b2.js';

/*
Example usage - targetedonc.com/latest-conference
const query = `*[!(_id in path("drafts.**")) && _type == "article" && defined(title) && is_visible == true && published <= '${today}' && references('b49d36b8-aa56-4183-a2bc-1568c229fb72') ] | order(published desc) [$from...$to] {
                    ...,
                    title,
                    summary,
                    thumbnail,
                    url,
                    published,
                    documentGroup->,
                    contentCategory->,
                    'pageNumber': ${currentPage}
                  }`

  const posts = await client.fetch(query, params)
*/

var ConferenceArticleCard = function ConferenceArticleCard(props) {
  var data = props.data;
      props.variant;
      props.index;
      var client = props.client;

  // title, thumbnail, summary, published, documentGroup.identifier.current, documentGroup.identifier.name

  return React__default.createElement(
    'div',
    { className: 'conference-media' },
    React__default.createElement(
      'a',
      { className: 'img-wrapper', href: '/view/' + (data.url ? data.url.current : '') },
      React__default.createElement('img', {
        className: 'mr-3 img-fluid',
        src: data.thumbnail && urlFor({ client: client, source: data.thumbnail.asset, imageWidth: 350 }),
        alt: data.title
      })
    ),
    React__default.createElement(
      'div',
      { className: 'media-body' },
      React__default.createElement(
        'a',
        { href: '/view/' + (data.url ? data.url.current : '') },
        React__default.createElement(
          'h4',
          { className: 'conf-media__card-title' },
          data.title
        )
      ),
      React__default.createElement(
        'p',
        { className: 'conf-media__card-text' },
        moment(data.published).format('MMMM Do YYYY, h:mma')
      ),
      React__default.createElement(
        'p',
        { className: 'mb-1 conference-group' },
        data.documentGroup && data.documentGroup.identifier && (data.documentGroup.identifier.current.includes('/') ? React__default.createElement(
          'a',
          { href: '/' + data.documentGroup.identifier.current, alt: data.thumbnail && data.thumbnail.alt || data.title },
          data.documentGroup.name
        ) : React__default.createElement(
          'a',
          { href: '/conference/' + data.documentGroup.identifier.current, alt: data.thumbnail && data.thumbnail.alt || data.title },
          data.documentGroup.name
        ))
      ),
      React__default.createElement('p', { className: 'pt-2 card-text', dangerouslySetInnerHTML: { __html: data.summary } })
    ),
    React__default.createElement(
      'style',
      { jsx: 'true' },
      '\n        .conference-media {\n          display: flex;\n          flex-direction: row;\n          margin-bottom: 1.25rem;\n          padding-bottom: 1.25rem;\n          border-bottom: 1px solid #ddd;\n        }\n        .conf-media__card-title {\n          font-weight: bold;\n          color: #252525;\n          margin-bottom: 0.5rem;\n          font-size: 1.5rem;\n        }\n        .conf-media__card-text {\n          color: var(--dark);\n          margin-bottom: 0.25rem;\n        }\n        .conference-media a img {\n          width: 175px;\n          min-width: 175px;\n          height: auto;\n          object-fit: contain;\n        }\n        .conference-media .conference-group {\n          background: #003767;\n          color: white;\n          border-radius: 5px;\n          display: inline-block;\n          padding: 0 0.25rem;\n        }\n        .conference-media .conference-group a {\n          color: white;\n          font-size: 0.8rem;\n        }\n        @media screen and (max-width: 1064px) {\n          .conf-media__card-title {\n            font-size: 1.1rem;\n          }\n        }\n        @media screen and (max-width: 768px) {\n          .conference-media {\n            flex-direction: column;\n          }\n          .conference-media a img {\n            width: 100%;\n            height: auto;\n            max-height: 175px;\n            object-fit: contain;\n            margin-bottom: 1rem;\n          }\n        }\n      '
    )
  );
};

export { ConferenceArticleCard as default };
