import * as Tooltip from '@radix-ui/react-tooltip'; import { forwardRef, type ForwardedRef, type ReactElement } from 'react'; interface TooltipProps { tooltip: React.ReactNode; children: ReactElement; sideOffset?: number; className?: string; arrowClassName?: string; tooltipStyle?: React.CSSProperties; position?: 'top' | 'bottom' | 'left' | 'right'; maxWidth?: number; delay?: number; } const WithTooltip = forwardRef( ( { tooltip, children, sideOffset = 5, className = '', arrowClassName = '', tooltipStyle = {}, position = 'top', maxWidth = 250, delay = 0, }: TooltipProps, _ref: ForwardedRef, ) => { return ( {children}
{tooltip}
); }, ); export default WithTooltip;