import _get from "lodash/fp/get";
import React from 'react';
import classnames from 'classnames';
import Provider from '../../atom/provider';
import Button from '../../atom/button';
import CardContentInfo, { MODES } from '../card-content';
import { propTypes } from './types';
import style from './style.css';
const Hero = (props, context) => {
  const {
    skin
  } = context;
  const {
    image,
    title,
    author,
    progress,
    onClick,
    submitValue,
    description,
    mode = MODES.HERO
  } = props;
  const primaryColor = _get('common.primary', skin);
  const cardStyle = classnames(style.hero, title ? style.defaultStyle : style.lazy);
  return /*#__PURE__*/React.createElement("div", {
    className: cardStyle,
    "data-name": "hero"
  }, /*#__PURE__*/React.createElement("div", {
    className: style.imageWrapper
  }, /*#__PURE__*/React.createElement("div", {
    "data-name": "cover",
    className: style.image,
    style: {
      backgroundColor: primaryColor,
      backgroundImage: image ? `url('${image}')` : 'none'
    }
  })), mode === MODES.HERO ? /*#__PURE__*/React.createElement(CardContentInfo, {
    mode: MODES.HERO,
    author: author,
    progress: progress,
    title: title
  }) : /*#__PURE__*/React.createElement("div", {
    className: style.infoWrapper
  }, /*#__PURE__*/React.createElement("h1", {
    className: style.title
  }, title), /*#__PURE__*/React.createElement("p", {
    className: style.description
  }, description)), mode === MODES.HERO ? /*#__PURE__*/React.createElement("div", {
    className: style.heroButtonWrapper
  }, /*#__PURE__*/React.createElement(Button, {
    type: "link",
    "data-name": "hero-button",
    onClick: onClick,
    submitValue: submitValue,
    className: style.heroButton,
    style: {
      backgroundColor: primaryColor
    }
  })) : null);
};
Hero.contextTypes = {
  skin: Provider.childContextTypes.skin
};
Hero.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
export default Hero;
//# sourceMappingURL=index.js.map