"use strict";

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

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

var _classnames = _interopRequireDefault(require("classnames"));

var _openData = require("../open-data");

var _getLocale = require("../../../utils/getLocale");

var _precls = _interopRequireDefault(require("../precls"));

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

function _default(props) {
  var onClick = props.onClick,
      selected = props.selected,
      type = props.type;
  return /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__content-search")),
    onClick: onClick
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__content-search-text"))
  }, function () {
    if (type == "depart") {
      return /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
        id: selected.id,
        name: selected.name
      });
    }

    if (type == "user") {
      return /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
        id: selected.id,
        name: selected.name
      });
    }

    return selected.name || (0, _getLocale.getLocale)("Mod_Pleaseselect");
  }()));
}