"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _avatar = _interopRequireDefault(require("../../../../components/avatar"));

var _wifi = _interopRequireDefault(require("./img/wifi.svg"));

require("./index.css");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var preCls = "titaui-dynamic-interview-share";

function InterviewContent(_ref) {
  var data = _ref.data;
  if (!data) return null;

  var _ref2 = data || {},
      toUser = _ref2.toUser,
      fromUser = _ref2.fromUser,
      content = _ref2.content,
      objId = _ref2.objId;

  var _window$location = window.location,
      host = _window$location.host,
      pathname = _window$location.pathname;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "__content")
  }, /*#__PURE__*/_react["default"].createElement(_avatar["default"], {
    name: fromUser.name,
    userId: fromUser.userId,
    color: fromUser.avatar.color,
    src: fromUser.avatar.medium,
    size: {
      width: 32,
      textNum: 1,
      fontSize: 12
    }
  }), /*#__PURE__*/_react["default"].createElement("img", {
    className: "".concat(preCls, "__wifi"),
    src: _wifi["default"],
    alt: "wifi"
  }), toUser && /*#__PURE__*/_react["default"].createElement(_avatar["default"], {
    name: toUser.name,
    userId: toUser.userId,
    color: toUser.avatar.color,
    src: toUser.avatar.medium,
    size: {
      width: 32,
      textNum: 1,
      fontSize: 12
    }
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "__name")
  }, /*#__PURE__*/_react["default"].createElement("a", {
    href: "//".concat(host).concat(pathname, "#/interview?hideNavTop=true&reactRouterName=detail&recordId=").concat(objId, "&toUserId=").concat(toUser.userId),
    target: "_blank",
    rel: "noreferrer"
  }, content || "")));
}

var _default = InterviewContent;
exports["default"] = _default;