// @flow import * as React from 'react'; import classnames from 'classnames'; type Props = { body: ?string, label?: string, children: ?React.Node, icon: ?boolean, direction: string, }; class ToolTip extends React.PureComponent { static defaultProps = { direction: 'top', }; render() { const { children, label, body, icon, direction } = this.props; const tooltipContent = children || label; return ( {tooltipContent} {body && ( // body may be undefined for some icons until we add messages for them {body} )} ); } } export default ToolTip;