import {
Hovercard,
HovercardAnchor,
useHovercardState,
} from 'ariakit/hovercard'
type BasePlacement = 'top' | 'bottom' | 'left' | 'right'
export type TooltipPlacement =
| BasePlacement
| `${BasePlacement}-start`
| `${BasePlacement}-end`
export default function IVTooltip({
id,
text,
children,
placement = 'top',
className,
tabIndex,
showTimeout = 250,
hideTimeout = 250,
}: {
id?: string
text: React.ReactNode
children: React.ReactNode
placement?: TooltipPlacement
className?: string
tabIndex?: number
showTimeout?: number
hideTimeout?: number
}) {
const hovercard = useHovercardState({
animated: 300,
placement,
gutter: 10,
showTimeout,
hideTimeout,
})
if (!text) {
return <>{children}>
}
return (
<>
{children}
{text}
>
)
}