'use strict';

var React = require('react');
var Head = require('next/head');
var reactShare = require('react-share');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);

var SocialShare = function SocialShare(props) {
  var shareUrl = props.shareUrl,
      shareTitle = props.shareTitle,
      shareVia = props.shareVia,
      shareSummary = props.shareSummary,
      shareSubject = props.shareSubject,
      shareImage = props.shareImage,
      size = props.size,
      siteName = props.siteName,
      twitterSiteName = props.twitterSiteName,
      _props$disableMeta = props.disableMeta,
      disableMeta = _props$disableMeta === undefined ? false : _props$disableMeta,
      hidePinterest = props.hidePinterest,
      hideFacebook = props.hideFacebook;

  return React__default["default"].createElement(
    React__default["default"].Fragment,
    null,
    !disableMeta && React__default["default"].createElement(
      Head__default["default"],
      null,
      React__default["default"].createElement('meta', { property: 'og:url', content: shareUrl, key: 'og:url' }),
      React__default["default"].createElement('meta', { property: 'og:title', content: shareTitle, key: 'og:title' }),
      React__default["default"].createElement('meta', { property: 'og:image', content: shareImage, key: 'og:image' }),
      React__default["default"].createElement('meta', { property: 'og:site_name', content: siteName, key: 'og:site_name' }),
      React__default["default"].createElement('meta', { property: 'og:description', content: shareSummary, key: 'og:description' }),
      React__default["default"].createElement('meta', { name: 'twitter:card', content: 'summary', key: 'og:card' }),
      React__default["default"].createElement('meta', { name: 'twitter:title', content: shareTitle, key: 'og:title' }),
      React__default["default"].createElement('meta', { name: 'twitter:image', content: shareImage, key: 'og:image' }),
      React__default["default"].createElement('meta', { name: 'twitter:site', content: twitterSiteName, key: 'og:site' }),
      React__default["default"].createElement('meta', { name: 'twitter:description', content: shareSummary, key: 'og:description' })
    ),
    !hideFacebook && React__default["default"].createElement(
      reactShare.FacebookShareButton,
      { url: shareUrl, quote: shareTitle },
      React__default["default"].createElement(reactShare.FacebookIcon, { size: size, round: true })
    ),
    React__default["default"].createElement(
      reactShare.TwitterShareButton,
      { url: shareUrl, title: shareTitle, via: shareVia },
      React__default["default"].createElement(reactShare.TwitterIcon, { size: size, round: true })
    ),
    React__default["default"].createElement(
      reactShare.LinkedinShareButton,
      { url: shareUrl, title: shareTitle, via: shareVia },
      React__default["default"].createElement(reactShare.LinkedinIcon, { size: size, round: true })
    ),
    !hidePinterest && React__default["default"].createElement(
      reactShare.PinterestShareButton,
      { url: shareUrl, media: shareImage, description: shareSummary },
      React__default["default"].createElement(reactShare.PinterestIcon, { size: size, round: true })
    ),
    React__default["default"].createElement(
      reactShare.EmailShareButton,
      { url: shareUrl, subject: shareSubject, body: shareSummary },
      React__default["default"].createElement(reactShare.EmailIcon, { size: size, round: true })
    )
  );
};

var SocialShare$1 = React__default["default"].memo(SocialShare);

module.exports = SocialShare$1;
