"use strict";

exports.__esModule = true;
exports.default = void 0;
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _classnames = _interopRequireDefault(require("classnames"));
var _link = _interopRequireDefault(require("../../atom/link"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _avatar = _interopRequireDefault(require("../../atom/avatar"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const BattleRequest = (props, context) => {
  const {
    translate,
    skin
  } = context;
  const {
    username,
    discipline,
    level,
    avatar,
    href
  } = props;
  const primaryColor = (0, _get2.default)('common.primary', skin);
  const light = (0, _get2.default)('common.light', skin);
  const challengeLabel = translate('challenges you on');
  const startLabel = translate('Start battle');
  return /*#__PURE__*/_react.default.createElement(_link.default, {
    "data-name": "battle-request-dashboard",
    className: _style.default.card,
    style: {
      borderColor: primaryColor
    },
    href: href
  }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_avatar.default, {
    url: avatar
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.info
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.name
  }, username, /*#__PURE__*/_react.default.createElement("span", null, challengeLabel)), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.discipline
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _classnames.default)(_style.default.disciplineName, _style.default.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: discipline
    }
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.level
  }, level))), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.start
  }, startLabel), /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowRight, {
    className: _style.default.arrow,
    style: {
      color: light
    }
  }));
};
BattleRequest.contextTypes = {
  skin: _provider.default.childContextTypes.skin,
  translate: _provider.default.childContextTypes.translate
};
BattleRequest.propTypes = process.env.NODE_ENV !== "production" ? {
  username: _propTypes.default.string,
  discipline: _propTypes.default.string,
  level: _propTypes.default.string,
  avatar: _propTypes.default.string,
  href: _propTypes.default.string
} : {};
var _default = exports.default = BattleRequest;
//# sourceMappingURL=index.js.map