"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

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

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

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

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

var _icon = _interopRequireDefault(require("../icon"));

var IconItem = function IconItem(props) {
  var prefixCls = props.prefixCls,
      type = props.type,
      onSelect = props.onSelect,
      active = props.active,
      customFontName = props.customFontName;
  var handleClick = (0, _react.useCallback)(function () {
    onSelect(type);
  }, [type, onSelect]);
  return /*#__PURE__*/_react["default"].createElement("li", {
    className: (0, _classnames["default"])((0, _defineProperty2["default"])({}, "".concat(prefixCls, "-item-selected"), active))
  }, /*#__PURE__*/_react["default"].createElement("div", {
    onClick: handleClick
  }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
    customFontName: customFontName,
    type: type
  }), /*#__PURE__*/_react["default"].createElement("p", null, type)));
};

IconItem.displayName = 'IconItem';

var _default = /*#__PURE__*/(0, _react.memo)(IconItem);

exports["default"] = _default;
//# sourceMappingURL=IconItem.js.map
