import type { PropsWithChildren } from "react"; import React, { useRef, useEffect, useState } from "react"; import { classNames } from "@calcom/lib"; const ScrollableArea = ({ children, className }: PropsWithChildren<{ className?: string }>) => { const scrollableRef = useRef(null); const [isOverflowingY, setIsOverflowingY] = useState(false); useEffect(() => { const scrollableElement = scrollableRef.current; if (scrollableElement) { const isElementOverflowing = scrollableElement.scrollHeight > scrollableElement.clientHeight; console.log({ isElementOverflowing }); setIsOverflowingY(isElementOverflowing); } }, []); return (
{children} {isOverflowingY &&
}
); }; export { ScrollableArea };