import React, { useState } from "react"; import { Tooltip as ReactTooltip } from "react-tooltip"; import FlexContainer, { FlexContainerProps } from "../FlexContainer"; import { defaultTheme } from "@/lib"; import { TooltipIcon } from "@/icons"; import { generateUUID } from "@/utils"; import Typography from "../Typography"; export type TooltipBoxProps = { content?: string | React.ReactNode; tooltipWidth?: number; children?: React.ReactNode; color?: string; childrenContainerFlexProps?: FlexContainerProps; tooltipStyleOptions?: React.CSSProperties; noArrow?: boolean; direction?: | "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end"; }; export default function TooltipBox({ content, tooltipWidth = 40, color = defaultTheme.colors.white, tooltipStyleOptions, children = ( ), childrenContainerFlexProps, direction, noArrow = false, }: TooltipBoxProps) { const [tooltipId] = useState(generateUUID()); return ( <> {children} {typeof content === "string" ? ( {content} ) : ( content )} ); }