"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
// This component is a simpler version of the generic Chip component, in use in CoorpManager.

const Chips = props => {
  const {
    text,
    information,
    selected = false,
    onClick
  } = props;
  const handleClick = (0, _react.useMemo)(() => () => onClick(), [onClick]);
  return /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _classnames.default)(_style.default.container, selected ? _style.default.selected : _style.default.unselected),
    onClick: handleClick,
    "aria-label": `${text} ${information}`,
    "data-name": text
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.textZone,
    title: text
  }, /*#__PURE__*/_react.default.createElement("span", {
    className: _style.default.text
  }, text), /*#__PURE__*/_react.default.createElement("span", {
    className: _style.default.information
  }, information)), selected ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusCheckCircle2, {
    className: _style.default.selectedIconWrapper
  }) : /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidRemoveAddAddCircle1, {
    className: _style.default.unselectedIconWrapper
  }));
};
Chips.propTypes = process.env.NODE_ENV !== "production" ? {
  text: _propTypes.default.string,
  information: _propTypes.default.string,
  selected: _propTypes.default.bool,
  onClick: _propTypes.default.func
} : {};
var _default = exports.default = Chips;
//# sourceMappingURL=index.js.map