pawarprasad123 commented on code in PR #728:
URL: https://github.com/apache/atlas/pull/728#discussion_r3824947836


##########
dashboard/src/components/muiComponents.tsx:
##########
@@ -68,6 +71,64 @@ const LightTooltip = styled(({ className, ...props }: any) 
=> (
   }
 }));
 
+
+interface OverflowTooltipProps extends Omit<TooltipProps, 'children'> {
+  children: React.ReactElement;
+  wrapperComponent?: React.ElementType;
+  wrapperSx?: SxProps<Theme>;
+}
+
+const OverflowTooltip = ({ title, children, wrapperComponent, wrapperSx, 
...props }: OverflowTooltipProps) => {
+  const textElementRef = React.useRef<HTMLElement>(null);
+  const [isOverflowed, setIsOverflowed] = React.useState(false);
+
+  const checkOverflow = () => {
+    if (textElementRef.current) {
+      setIsOverflowed(
+        textElementRef.current.scrollWidth > textElementRef.current.clientWidth
+      );
+    }
+  };
+
+  React.useLayoutEffect(() => {
+    checkOverflow();
+    window.addEventListener("resize", checkOverflow);
+    return () => {
+      window.removeEventListener("resize", checkOverflow);
+    };
+  }, [title]);
+
+  const child = (
+    <Box
+      component={wrapperComponent || 'span'}

Review Comment:
   verify this once
   
   Unused API surface: wrapperComponent prop is defined but never used by any 
consumer.



##########
dashboard/src/components/muiComponents.tsx:
##########
@@ -51,6 +52,8 @@ import MuiAccordionSummary, {
   AccordionSummaryProps
 } from "@mui/material/AccordionSummary";
 import MuiAccordionDetails from "@mui/material/AccordionDetails";
+import { TooltipProps } from '@mui/material/Tooltip';

Review Comment:
   Mixed quote styles in muiComponents.tsx: new imports use single quotes 
('@mui/material/Tooltip') while the rest of the file uses double quotes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to