import { Tooltip } from "@mui/joy"; import classNames from "classnames"; import { useRef, useState, useEffect } from "react"; interface Props { children: React.ReactNode; className?: string; } const OverflowTip = ({ children, className }: Props) => { const [isOverflowed, setIsOverflow] = useState(false); const textElementRef = useRef(null); useEffect(() => { if (!textElementRef.current) { return; } setIsOverflow(textElementRef.current.scrollWidth > textElementRef.current.clientWidth); }, []); return (
{children}
); }; export default OverflowTip;