import React__default from 'react';
import Head from 'next/head';
import urlFor from '@mjhls/mjh-framework/dist/cjs/urlFor';

var Header = function Header(props) {
  var title = props.title,
      keyword = props.keyword,
      description = props.description,
      isLiveSite = props.isLiveSite,
      canonicalUrl = props.canonicalUrl,
      addOpenGraph = props.addOpenGraph,
      docGroup = props.docGroup,
      client = props.client;


  return addOpenGraph && docGroup ? React__default.createElement(
    Head,
    null,
    title && React__default.createElement(
      'title',
      null,
      title
    ),
    keyword && React__default.createElement('meta', { name: 'keywords', content: keyword }),
    description && React__default.createElement('meta', { name: 'description', content: description, key: 'description' }),
    !isLiveSite && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
    canonicalUrl && React__default.createElement('link', { rel: 'canonical', href: canonicalUrl, key: 'canonical' }),
    React__default.createElement('meta', { name: 'twitter:card', content: 'summary' }),
    React__default.createElement('meta', { name: 'twitter:title', content: docGroup.name }),
    React__default.createElement('meta', { name: 'twitter:site', content: '@cancernetwrk' }),
    React__default.createElement('meta', { name: 'twitter:image', content: urlFor({ client: client, source: docGroup.thumbnail, imageHeight: 630, imageWidth: 1200, imageMaxHeight: null, imageFit: null }) }),
    React__default.createElement('meta', { name: 'twitter:description', content: docGroup.description[0].children[0].text }),
    React__default.createElement('meta', { property: 'og:title', content: docGroup.name }),
    React__default.createElement('meta', { property: 'og:site_name', content: 'Cancer Network' }),
    React__default.createElement('meta', { property: 'og:url', content: 'https://www.cancernetwork.com' + props.url }),
    React__default.createElement('meta', { property: 'og:image', content: urlFor({ client: client, source: docGroup.thumbnail, imageHeight: 630, imageWidth: 1200, imageMaxHeight: null, imageFit: null }) })
  ) : React__default.createElement(
    Head,
    null,
    title && React__default.createElement(
      'title',
      null,
      title
    ),
    keyword && React__default.createElement('meta', { name: 'keywords', content: keyword }),
    description && React__default.createElement('meta', { name: 'description', content: description, key: 'description' }),
    !isLiveSite && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
    canonicalUrl && React__default.createElement('link', { rel: 'canonical', href: canonicalUrl, key: 'canonical' })
  );
};

var Header$1 = React__default.memo(Header);

export { Header, Header$1 as default };
