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,
|
2018-12-12 17:36:11 +00:00
|
|
|
info?: boolean,
|
2017-09-25 21:32:58 +00:00
|
|
|
};
|
2017-07-22 00:55:34 +00:00
|
|
|
|
2017-09-25 21:32:58 +00:00
|
|
|
@autobind
|
|
|
|
class HelpTooltip extends React.PureComponent<Props> {
|
2018-06-25 17:42:50 +00:00
|
|
|
render() {
|
|
|
|
const { children, className, style, info } = this.props;
|
2017-03-28 22:45:23 +00:00
|
|
|
return (
|
2018-10-17 16:42:33 +00:00
|
|
|
<Tooltip position="top" className={className} message={children} style={style}>
|
|
|
|
<i className={'fa ' + (info ? 'fa-info-circle' : 'fa-question-circle')} />
|
2017-03-28 22:45:23 +00:00
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default HelpTooltip;
|