'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactBootstrap = require('react-bootstrap');

var _uuid = require('uuid');

var _uuid2 = _interopRequireDefault(_uuid);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * @param {object} props react props
 * @example
const props = {
	label: 'Help content here',
	tooltipPlacement: 'top',
};
<TooltipTrigger {...props} >
	<Icon name="my-icon" />
</TooltipTrigger>
 */
function TooltipTrigger(props) {
	var tooltip = _react2.default.createElement(
		_reactBootstrap.Tooltip,
		{ id: _uuid2.default.v4() },
		props.label
	);
	return _react2.default.createElement(
		_reactBootstrap.OverlayTrigger,
		{ placement: props.tooltipPlacement, overlay: tooltip },
		props.children
	);
}

TooltipTrigger.propTypes = {
	children: _react.PropTypes.element,
	label: _react.PropTypes.string,
	tooltipPlacement: _reactBootstrap.OverlayTrigger.propTypes.placement
};

exports.default = TooltipTrigger;