UNPKG

react-spatial

Version:

Components to build React map apps.

41 lines (34 loc) 958 B
import React from 'react'; import PropTypes from 'prop-types'; import Button from '../Button'; var propTypes = { /** Sets the Tab to active (adds active class) */ active: PropTypes.bool, /** CSS class of the Tab */ className: PropTypes.string, /** Title of the Tab */ title: PropTypes.string.isRequired, /** Function triggered on click event */ onClick: PropTypes.func.isRequired, }; var defaultProps = { active: false, className: 'tm-tab', }; var Tab = function (ref) { var onClick = ref.onClick; var active = ref.active; var className = ref.className; var title = ref.title; return ( React.createElement( 'li', { className: className + (active ? ' tm-active' : '') }, React.createElement( Button, { title: title, onClick: function (e) { return onClick(e); } }, title ) ) ); }; Tab.propTypes = propTypes; Tab.defaultProps = defaultProps; export default Tab; //# sourceMappingURL=Tab.js.map