mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-23 06:21:05 +00:00
no log: Remove provider tooltip unused hook and ref
This commit is contained in:
parent
8dc3e5d706
commit
1cc5c428ca
1 changed files with 2 additions and 10 deletions
|
@ -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 {
|
||||
|
@ -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>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue