import * as React from 'react'; import { Tooltip as ChakraTooltip, Portal } from '@chakra-ui/react'; export interface TooltipProps extends ChakraTooltip.RootProps { showArrow?: boolean; portalled?: boolean; portalRef?: React.RefObject; content: React.ReactNode; contentProps?: ChakraTooltip.ContentProps; disabled?: boolean; } export const Tooltip = React.forwardRef( function Tooltip(props, ref) { const { showArrow, children, disabled, portalled = true, content, contentProps, portalRef, ...rest } = props; if (disabled) return children; return ( {children} {showArrow && ( )} {content} ); } );