no log: Remove provider tooltip unused hook and ref

pull/2786/head
Anderson Shindy Oki 1 month ago
parent 8dc3e5d706
commit 1cc5c428ca

@ -1,6 +1,5 @@
import { FunctionComponent, ReactElement } from "react"; import { FunctionComponent, ReactElement } from "react";
import { Tooltip, TooltipProps } from "@mantine/core"; import { Tooltip, TooltipProps } from "@mantine/core";
import { useHover } from "@mantine/hooks";
import { isNull, isUndefined } from "lodash"; import { isNull, isUndefined } from "lodash";
interface TextPopoverProps { interface TextPopoverProps {
@ -14,20 +13,13 @@ const TextPopover: FunctionComponent<TextPopoverProps> = ({
text, text,
tooltip, tooltip,
}) => { }) => {
const { hovered, ref } = useHover();
if (isNull(text) || isUndefined(text)) { if (isNull(text) || isUndefined(text)) {
return children; return children;
} }
return ( return (
<Tooltip <Tooltip label={text} {...tooltip} style={{ textWrap: "wrap" }}>
opened={hovered} <div>{children}</div>
label={text}
{...tooltip}
style={{ textWrap: "wrap" }}
>
<div ref={ref}>{children}</div>
</Tooltip> </Tooltip>
); );
}; };

Loading…
Cancel
Save