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

46 lines
929 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,
className?: string,
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,
className,
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}
classes={{ tooltip: className }}
>
{children}
</MUITooltip>
);
2018-03-26 23:32:43 +02:00
}
export default Tooltip;