import { FunctionComponent, ReactElement } from "react"; import { Tooltip, TooltipProps } from "@mantine/core"; import { useHover } from "@mantine/hooks"; import { isNull, isUndefined } from "lodash"; interface TextPopoverProps { children: ReactElement; text: string | undefined | null; tooltip?: Omit; } const TextPopover: FunctionComponent = ({ children, text, tooltip, }) => { const { hovered, ref } = useHover(); if (isNull(text) || isUndefined(text)) { return children; } return (
{children}
); }; export default TextPopover;