"use strict";

exports.__esModule = true;
exports.default = void 0;
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _style = _interopRequireDefault(require("./style.css"));
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; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const Tab = ({
  onClick,
  links,
  title,
  targetContent
}) => {
  const handleTabClick = (0, _react.useMemo)(() => () => onClick(targetContent), [onClick, targetContent]);
  return /*#__PURE__*/_react.default.createElement("div", {
    "data-name": "tab",
    className: _style.default.tab,
    onClick: handleTabClick
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.title
  }, title), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.link
  }, (0, _map2.default)(link => /*#__PURE__*/_react.default.createElement("div", {
    key: link.title
  }, link.title), links)));
};
Tab.propTypes = process.env.NODE_ENV !== "production" ? {
  title: _propTypes.default.string,
  links: _propTypes.default.arrayOf(_propTypes.default.objectOf(_propTypes.default.string)),
  onClick: _propTypes.default.func,
  targetContent: _propTypes.default.string
} : {};
var _default = exports.default = Tab;
//# sourceMappingURL=index.js.map