import _map from "lodash/fp/map";
import React, { useMemo } from 'react';
import PropTypes from 'prop-types';
import style from './style.css';
const Tab = ({
  onClick,
  links,
  title,
  targetContent
}) => {
  const handleTabClick = useMemo(() => () => onClick(targetContent), [onClick, targetContent]);
  return /*#__PURE__*/React.createElement("div", {
    "data-name": "tab",
    className: style.tab,
    onClick: handleTabClick
  }, /*#__PURE__*/React.createElement("div", {
    className: style.title
  }, title), /*#__PURE__*/React.createElement("div", {
    className: style.link
  }, _map(link => /*#__PURE__*/React.createElement("div", {
    key: link.title
  }, link.title), links)));
};
Tab.propTypes = process.env.NODE_ENV !== "production" ? {
  title: PropTypes.string,
  links: PropTypes.arrayOf(PropTypes.objectOf(PropTypes.string)),
  onClick: PropTypes.func,
  targetContent: PropTypes.string
} : {};
export default Tab;
//# sourceMappingURL=index.js.map