import useOverlayScroller from '@/hooks/use-overlay-scroller'; import { Tooltip, TooltipProps } from 'antd'; import React from 'react'; import styled from 'styled-components'; const Wrapper = styled.div<{ $maxHeight?: number }>` max-height: ${({ $maxHeight }) => typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight}; overflow-y: auto; width: 100%; `; const OverlayScroller: React.FC = ({ children, maxHeight, theme, style }) => { const scroller = React.useRef(null); const { initialize } = useOverlayScroller({ options: { theme: theme || 'os-theme-light' } }); React.useEffect(() => { if (scroller.current) { initialize(scroller.current); } }, []); return ( ); }; export const TooltipOverlayScroller: React.FC< TooltipProps & { maxHeight?: number } > = ({ children, maxHeight, title, ...rest }) => { return ( {title} ) } {...rest} > {children} ); }; export default OverlayScroller;