2018-03-26 23:32:43 +02:00
|
|
|
// @flow
|
2019-06-28 09:27:55 +02:00
|
|
|
import React from 'react';
|
2021-12-20 13:38:12 +01:00
|
|
|
import MUITooltip from '@mui/material/Tooltip';
|
|
|
|
import type { Node } from 'react';
|
2018-03-26 23:32:43 +02:00
|
|
|
|
|
|
|
type Props = {
|
2021-12-20 13:38:12 +01:00
|
|
|
arrow?: boolean,
|
2019-10-17 18:51:16 +02:00
|
|
|
children: Node,
|
2021-12-20 13:38:12 +01:00
|
|
|
disableInteractive?: boolean,
|
|
|
|
enterDelay?: number,
|
|
|
|
title?: string | Node,
|
2022-01-11 17:42:12 +01:00
|
|
|
followCursor?: boolean,
|
|
|
|
placement?: string, // https://mui.com/api/tooltip/
|
2018-03-26 23:32:43 +02:00
|
|
|
};
|
|
|
|
|
2019-06-28 09:27:55 +02:00
|
|
|
function Tooltip(props: Props) {
|
2022-01-11 17:42:12 +01:00
|
|
|
const {
|
|
|
|
arrow = true,
|
|
|
|
children,
|
|
|
|
disableInteractive = true,
|
|
|
|
enterDelay = 300,
|
|
|
|
title,
|
|
|
|
followCursor = false,
|
|
|
|
placement = 'bottom',
|
|
|
|
} = props;
|
2018-03-26 23:32:43 +02:00
|
|
|
|
2021-12-20 13:38:12 +01:00
|
|
|
return (
|
|
|
|
<MUITooltip
|
|
|
|
arrow={arrow}
|
|
|
|
disableInteractive={disableInteractive}
|
|
|
|
enterDelay={enterDelay}
|
|
|
|
enterNextDelay={enterDelay}
|
|
|
|
title={title}
|
2022-01-11 17:42:12 +01:00
|
|
|
followCursor={followCursor}
|
|
|
|
placement={placement}
|
2021-12-20 13:38:12 +01:00
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</MUITooltip>
|
|
|
|
);
|
2018-03-26 23:32:43 +02:00
|
|
|
}
|
|
|
|
|
2019-06-28 09:27:55 +02:00
|
|
|
export default Tooltip;
|