import * as TooltipPrimitive from '@radix-ui/react-tooltip'; import { forwardRef, type ForwardedRef, type ReactElement } from 'react'; import { classNames } from '~/utils/classNames'; // Original WithTooltip component interface WithTooltipProps { 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, }: WithTooltipProps, _ref: ForwardedRef, ) => { return ( {children}
{tooltip}
); }, ); // New Tooltip component with simpler API interface TooltipProps { content: React.ReactNode; children: React.ReactNode; side?: 'top' | 'right' | 'bottom' | 'left'; align?: 'start' | 'center' | 'end'; delayDuration?: number; className?: string; } export function Tooltip({ content, children, side = 'top', align = 'center', delayDuration = 300, className, }: TooltipProps) { return ( {children} {content} ); } export default WithTooltip;