import _getOr from "lodash/fp/getOr";
import _get from "lodash/fp/get";
import React from 'react';
import PropTypes from 'prop-types';
import { SrcPropType } from '../../util/proptypes';
import Provider from '../../atom/provider';
import Link from '../../atom/link';
import style from './style.css';
function Hero(props, context) {
  const {
    skin
  } = context;
  const bg = _get('images.hero', skin);
  const {
    url,
    title,
    touch = false
  } = props;
  const backgroundImage = bg ? `url(${bg})` : '';
  const ctaClass = touch ? 'ctaTouch' : 'ctaNoTouch';
  return /*#__PURE__*/React.createElement("div", {
    className: style.hero,
    style: {
      backgroundImage
    }
  }, /*#__PURE__*/React.createElement(Link, {
    href: url,
    className: style[ctaClass]
  }, /*#__PURE__*/React.createElement("div", {
    className: style.label,
    style: {
      color: _getOr('#00b0ff', 'common.primary', skin)
    }
  }, title, /*#__PURE__*/React.createElement("span", {
    className: style.bar,
    style: {
      backgroundColor: _getOr('#00b0ff', 'common.primary', skin)
    }
  }))));
}
Hero.contextTypes = {
  skin: Provider.childContextTypes.skin
};
Hero.propTypes = process.env.NODE_ENV !== "production" ? {
  touch: PropTypes.bool,
  url: PropTypes.oneOfType([SrcPropType, PropTypes.string]).isRequired,
  title: PropTypes.string.isRequired
} : {};
export default Hero;
//# sourceMappingURL=index.js.map