import _get from "lodash/fp/get";
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { NovaLineFilesOfficeFileOfficePdf as PDFIcon } from '@coorpacademy/nova-icons';
import Link from '../../atom/link';
import Provider from '../../atom/provider';
import style from './style.css';
const PDF = (props, context) => {
  const {
    description,
    mediaUrl,
    poster,
    onPlay
  } = props;
  const {
    translate,
    skin
  } = context;
  const white = _get('common.white', skin);
  const primary = _get('common.primary', skin);
  return /*#__PURE__*/React.createElement("div", {
    className: style.pdfFrame,
    style: {
      backgroundImage: `url(${poster})`
    }
  }, /*#__PURE__*/React.createElement(PDFIcon, {
    style: {
      color: white
    },
    className: style.pdfIcon
  }), /*#__PURE__*/React.createElement("div", {
    className: classnames(style.pdfDescription, style.innerHTML),
    "data-name": "pdfDescription"
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: description
    }
  }), /*#__PURE__*/React.createElement(Link, {
    href: mediaUrl,
    target: "_blank",
    onClick: onPlay
  }, /*#__PURE__*/React.createElement("div", {
    className: style.openPDFButton
  }, /*#__PURE__*/React.createElement("div", {
    className: style.openPDFButtonBackground,
    style: {
      backgroundColor: primary
    }
  }), /*#__PURE__*/React.createElement("label", {
    className: style.openPDFButtonLabel
  }, translate('Open')))));
};
PDF.contextTypes = {
  translate: Provider.childContextTypes.translate,
  skin: Provider.childContextTypes.skin
};
PDF.propTypes = process.env.NODE_ENV !== "production" ? {
  description: PropTypes.string,
  mediaUrl: PropTypes.string,
  poster: PropTypes.string,
  onPlay: PropTypes.func
} : {};
export default PDF;
//# sourceMappingURL=index.js.map