import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["contentBg", "headImg", "userName", "levelImg", "isLogin", "handleClick"];
import React from 'react';
import "./index.scss";
import defaultImg from "../../assets/icon/mine/default.png";
import arrowImg from "../../assets/icon/mine/right.png";
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 = _objectWithoutPropertiesLoose(_ref, _excluded);
  var _otherProps = otherProps || {};
  var onTap = function onTap() {
    if (handleClick) {
      handleClick(isLogin);
    }
  };
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "user-info"
  }, _otherProps), contentBg ? /*#__PURE__*/React.createElement("img", {
    className: "user-info-bg",
    src: contentBg,
    alt: ""
  }) : null, /*#__PURE__*/React.createElement("div", {
    className: "content",
    onClick: onTap
  }, /*#__PURE__*/React.createElement("div", {
    className: "info-box"
  }, headImg && isLogin ? /*#__PURE__*/React.createElement("img", {
    className: "head-img",
    src: headImg,
    alt: ""
  }) : /*#__PURE__*/React.createElement("img", {
    className: "head-img",
    src: defaultImg,
    alt: ""
  }), isLogin ? /*#__PURE__*/React.createElement("div", {
    className: "info"
  }, userName && /*#__PURE__*/React.createElement("div", {
    className: "user-name"
  }, userName), levelImg && /*#__PURE__*/React.createElement("img", {
    className: "level",
    src: levelImg,
    alt: ""
  })) : /*#__PURE__*/React.createElement("div", {
    className: "no-login"
  }, "\u767B\u5F55/\u6CE8\u518C")), /*#__PURE__*/React.createElement("img", {
    className: "arrow",
    src: arrowImg,
    alt: ""
  })));
};
UserCard.displayName = 'UserCard';
export default UserCard;