'use client'; import clsx from 'clsx'; import { ReactNode } from 'react'; import { createPortal } from 'react-dom'; import { ITooltip, Tooltip as TooltipImpl } from 'react-tooltip'; import { useConceptOptions } from '@/context/ConceptOptionsContext'; export type { PlacesType } from 'react-tooltip'; interface TooltipProps extends Omit { /** Text to display in the tooltip. */ text?: string; /** Classname for z-index */ layer?: string; } /** * Displays content in a tooltip container. */ function Tooltip({ text, children, layer = 'z-tooltip', place = 'bottom', className, style, ...restProps }: TooltipProps) { const { darkMode } = useConceptOptions(); if (typeof window === 'undefined') { return null; } return createPortal( {text ? text : null} {children as ReactNode} , document.body ); } export default Tooltip;