mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
36 lines
780 B
JavaScript
36 lines
780 B
JavaScript
|
// @flow
|
||
|
import * as React from 'react';
|
||
|
import autobind from 'autobind-decorator';
|
||
|
import Tooltip from './tooltip';
|
||
|
import SvgIcon from './svg-icon';
|
||
|
|
||
|
type Props = {
|
||
|
children: React.Node,
|
||
|
|
||
|
// Optional
|
||
|
position?: 'bottom' | 'top' | 'right' | 'left',
|
||
|
delay?: number,
|
||
|
className?: string,
|
||
|
style?: Object,
|
||
|
info?: boolean,
|
||
|
};
|
||
|
|
||
|
@autobind
|
||
|
class HelpTooltip extends React.PureComponent<Props> {
|
||
|
render() {
|
||
|
const { children, className, style, info, position, delay } = this.props;
|
||
|
return (
|
||
|
<Tooltip
|
||
|
position={position}
|
||
|
delay={delay}
|
||
|
className={className}
|
||
|
message={children}
|
||
|
style={style}>
|
||
|
{info ? <SvgIcon icon="info" /> : <SvgIcon icon="question" />}
|
||
|
</Tooltip>
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default HelpTooltip;
|