2017-07-22 00:55:34 +00:00
|
|
|
// @flow
|
2017-09-25 21:32:58 +00:00
|
|
|
import * as React from 'react';
|
2017-03-28 22:45:23 +00:00
|
|
|
import autobind from 'autobind-decorator';
|
|
|
|
import Tooltip from './tooltip';
|
|
|
|
|
2017-09-25 21:32:58 +00:00
|
|
|
type Props = {
|
|
|
|
children: React.Node,
|
2017-07-22 00:55:34 +00:00
|
|
|
|
2017-09-25 21:32:58 +00:00
|
|
|
// Optional
|
|
|
|
position?: string,
|
|
|
|
className?: string,
|
|
|
|
style?: Object,
|
|
|
|
info?: boolean
|
|
|
|
};
|
2017-07-22 00:55:34 +00:00
|
|
|
|
2017-09-25 21:32:58 +00:00
|
|
|
@autobind
|
|
|
|
class HelpTooltip extends React.PureComponent<Props> {
|
2017-03-28 22:45:23 +00:00
|
|
|
render () {
|
2017-09-25 21:32:58 +00:00
|
|
|
const {children, className, style, info} = this.props;
|
2017-03-28 22:45:23 +00:00
|
|
|
return (
|
2017-09-25 21:32:58 +00:00
|
|
|
<Tooltip position="top" className={className} message={children} style={style}>
|
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;
|