import React, { MouseEvent } from 'react'; import Tippy, { type TippyProps } from '@tippyjs/react'; import clsx from 'clsx'; import _ from 'lodash'; import 'tippy.js/dist/tippy.css'; import styles from './TooltipWithChildren.module.css'; export type Position = 'top' | 'right' | 'bottom' | 'left'; export interface Props { position?: Position; message: React.ReactNode; className?: string; children: React.ReactElement; heading?: string; appendTo?: TippyProps['appendTo']; } export function TooltipWithChildren({ message, position = 'bottom', className, children, heading, appendTo, }: Props) { const id = _.uniqueId('tooltip-'); const messageHTML = ( // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions