lbry-desktop/ui/component/common/tooltip.jsx

43 lines
853 B
React
Raw Normal View History

2018-03-26 23:32:43 +02:00
// @flow
import React from 'react';
import MUITooltip from '@mui/material/Tooltip';
import type { Node } from 'react';
2018-03-26 23:32:43 +02:00
type Props = {
arrow?: boolean,
children: Node,
disableInteractive?: boolean,
enterDelay?: number,
title?: string | Node,
followCursor?: boolean,
placement?: string, // https://mui.com/api/tooltip/
2018-03-26 23:32:43 +02:00
};
function Tooltip(props: Props) {
const {
arrow = true,
children,
disableInteractive = true,
enterDelay = 300,
title,
followCursor = false,
placement = 'bottom',
} = props;
2018-03-26 23:32:43 +02:00
return (
<MUITooltip
arrow={arrow}
disableInteractive={disableInteractive}
enterDelay={enterDelay}
enterNextDelay={enterDelay}
title={title}
followCursor={followCursor}
placement={placement}
>
{children}
</MUITooltip>
);
2018-03-26 23:32:43 +02:00
}
export default Tooltip;