import _get from "lodash/fp/get";
import React from 'react';
import PropTypes from 'prop-types';
import { NovaCompositionNavigationArrowRight as ArrowRightIcon } from '@coorpacademy/nova-icons';
import classnames from 'classnames';
import Link from '../../atom/link';
import Provider from '../../atom/provider';
import Avatar from '../../atom/avatar';
import style from './style.css';
const BattleRequest = (props, context) => {
  const {
    translate,
    skin
  } = context;
  const {
    username,
    discipline,
    level,
    avatar,
    href
  } = props;
  const primaryColor = _get('common.primary', skin);
  const light = _get('common.light', skin);
  const challengeLabel = translate('challenges you on');
  const startLabel = translate('Start battle');
  return /*#__PURE__*/React.createElement(Link, {
    "data-name": "battle-request-dashboard",
    className: style.card,
    style: {
      borderColor: primaryColor
    },
    href: href
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Avatar, {
    url: avatar
  })), /*#__PURE__*/React.createElement("div", {
    className: style.info
  }, /*#__PURE__*/React.createElement("div", {
    className: style.name
  }, username, /*#__PURE__*/React.createElement("span", null, challengeLabel)), /*#__PURE__*/React.createElement("div", {
    className: style.discipline
  }, /*#__PURE__*/React.createElement("div", {
    className: classnames(style.disciplineName, style.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: discipline
    }
  }), /*#__PURE__*/React.createElement("div", {
    className: style.level
  }, level))), /*#__PURE__*/React.createElement("div", {
    className: style.start
  }, startLabel), /*#__PURE__*/React.createElement(ArrowRightIcon, {
    className: style.arrow,
    style: {
      color: light
    }
  }));
};
BattleRequest.contextTypes = {
  skin: Provider.childContextTypes.skin,
  translate: Provider.childContextTypes.translate
};
BattleRequest.propTypes = process.env.NODE_ENV !== "production" ? {
  username: PropTypes.string,
  discipline: PropTypes.string,
  level: PropTypes.string,
  avatar: PropTypes.string,
  href: PropTypes.string
} : {};
export default BattleRequest;
//# sourceMappingURL=index.js.map