Skip to content

Commit

Permalink
no log: Remove provider tooltip unused hook and ref
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-oki committed Dec 4, 2024
1 parent 8dc3e5d commit 1cc5c42
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions frontend/src/components/TextPopover.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FunctionComponent, ReactElement } from "react";
import { Tooltip, TooltipProps } from "@mantine/core";
import { useHover } from "@mantine/hooks";
import { isNull, isUndefined } from "lodash";

interface TextPopoverProps {
Expand All @@ -14,20 +13,13 @@ const TextPopover: FunctionComponent<TextPopoverProps> = ({
text,
tooltip,
}) => {
const { hovered, ref } = useHover();

if (isNull(text) || isUndefined(text)) {
return children;
}

return (
<Tooltip
opened={hovered}
label={text}
{...tooltip}
style={{ textWrap: "wrap" }}
>
<div ref={ref}>{children}</div>
<Tooltip label={text} {...tooltip} style={{ textWrap: "wrap" }}>
<div>{children}</div>
</Tooltip>
);
};
Expand Down

0 comments on commit 1cc5c42

Please sign in to comment.