2017-07-22 00:55:34 +00:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
2017-03-28 22:45:23 +00:00
|
|
|
import autobind from 'autobind-decorator';
|
|
|
|
import Tooltip from './tooltip';
|
|
|
|
|
|
|
|
@autobind
|
2017-07-22 00:55:34 +00:00
|
|
|
class HelpTooltip extends React.PureComponent {
|
|
|
|
props: {
|
|
|
|
children: React.Children,
|
|
|
|
|
|
|
|
// Optional
|
|
|
|
position?: string,
|
|
|
|
className?: string,
|
|
|
|
info?: boolean
|
|
|
|
};
|
|
|
|
|
2017-03-28 22:45:23 +00:00
|
|
|
render () {
|
2017-07-22 00:55:34 +00:00
|
|
|
const {children, className, info, ...props} = this.props;
|
2017-03-28 22:45:23 +00:00
|
|
|
return (
|
2017-08-11 21:44:34 +00:00
|
|
|
<Tooltip {...props} position="top" className={className} message={children}>
|
2017-07-22 00:55:34 +00:00
|
|
|
<i className={'fa ' + (info ? 'fa-info-circle' : 'fa-question-circle')}/>
|
2017-03-28 22:45:23 +00:00
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default HelpTooltip;
|