"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _react = _interopRequireDefault(require("react"));
require("./index.scss");
var _default2 = _interopRequireDefault(require("../../assets/icon/mine/default.png"));
var _right = _interopRequireDefault(require("../../assets/icon/mine/right.png"));
var _excluded = ["contentBg", "headImg", "userName", "levelImg", "isLogin", "handleClick"];
var UserCard = function UserCard(_ref) {
  var contentBg = _ref.contentBg,
    headImg = _ref.headImg,
    userName = _ref.userName,
    levelImg = _ref.levelImg,
    isLogin = _ref.isLogin,
    _ref$handleClick = _ref.handleClick,
    handleClick = _ref$handleClick === void 0 ? function (item) {
      console.log(item);
    } : _ref$handleClick,
    otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
  var _otherProps = otherProps || {};
  var onTap = function onTap() {
    if (handleClick) {
      handleClick(isLogin);
    }
  };
  return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
    className: "user-info"
  }, _otherProps), contentBg ? /*#__PURE__*/_react["default"].createElement("img", {
    className: "user-info-bg",
    src: contentBg,
    alt: ""
  }) : null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "content",
    onClick: onTap
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "info-box"
  }, headImg && isLogin ? /*#__PURE__*/_react["default"].createElement("img", {
    className: "head-img",
    src: headImg,
    alt: ""
  }) : /*#__PURE__*/_react["default"].createElement("img", {
    className: "head-img",
    src: _default2["default"],
    alt: ""
  }), isLogin ? /*#__PURE__*/_react["default"].createElement("div", {
    className: "info"
  }, userName && /*#__PURE__*/_react["default"].createElement("div", {
    className: "user-name"
  }, userName), levelImg && /*#__PURE__*/_react["default"].createElement("img", {
    className: "level",
    src: levelImg,
    alt: ""
  })) : /*#__PURE__*/_react["default"].createElement("div", {
    className: "no-login"
  }, "\u767B\u5F55/\u6CE8\u518C")), /*#__PURE__*/_react["default"].createElement("img", {
    className: "arrow",
    src: _right["default"],
    alt: ""
  })));
};
UserCard.displayName = 'UserCard';
var _default = exports["default"] = UserCard;