"use strict";

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

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

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

require("./index.css");

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

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var preCls = "titaui-drop-selector";

function _default(props) {
  var name = props.name,
      icon = props.icon,
      children = props.children,
      onClick = props.onClick,
      exIconClass = props.exIconClass;

  var onClickHandler = function onClickHandler() {
    onClick && onClick(name);
  };

  return /*#__PURE__*/_react["default"].createElement("div", {
    key: name,
    className: (0, _classnames["default"])("".concat(preCls, "__icon-item"), _defineProperty({}, "".concat(preCls, "__icon-item--noicon"), !icon)),
    onClick: onClickHandler
  }, icon && /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])(icon, "".concat(preCls, "__icon-item-icon"), exIconClass)
  }), /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(preCls, "__icon-item-text"))
  }, children));
}