2018-03-26 14:32:43 -07:00
|
|
|
// @flow
|
2019-06-28 03:27:55 -04:00
|
|
|
import type { Node } from 'react';
|
|
|
|
import React from 'react';
|
2021-02-16 16:09:20 -05:00
|
|
|
import ReachTooltip from '@reach/tooltip';
|
2021-06-18 14:44:40 +08:00
|
|
|
// import '@reach/tooltip/styles.css'; --> 'scss/third-party.scss'
|
2018-03-26 14:32:43 -07:00
|
|
|
|
|
|
|
type Props = {
|
2019-06-28 03:27:55 -04:00
|
|
|
label: string | Node,
|
2019-10-17 12:51:16 -04:00
|
|
|
children: Node,
|
2018-03-26 14:32:43 -07:00
|
|
|
};
|
|
|
|
|
2019-06-28 03:27:55 -04:00
|
|
|
function Tooltip(props: Props) {
|
|
|
|
const { children, label } = props;
|
2018-03-26 14:32:43 -07:00
|
|
|
|
2021-02-16 16:09:20 -05:00
|
|
|
return <ReachTooltip label={label}>{children}</ReachTooltip>;
|
2018-03-26 14:32:43 -07:00
|
|
|
}
|
|
|
|
|
2019-06-28 03:27:55 -04:00
|
|
|
export default Tooltip;
|