import { type PropsWithChildren, useState } from "react" import { tooltipVariants } from "./variants" import styles from "./tooltip.module.css" import { Typography } from "../Typography" type TooltipPosition = "left" | "right" | "top" | "bottom" type VerticalArrow = "top" | "bottom" | "center" type HorizontalArrow = "left" | "right" | "center" type ValidArrowMap = { left: VerticalArrow right: VerticalArrow top: HorizontalArrow bottom: HorizontalArrow } type ValidArrow
= P extends keyof ValidArrowMap ? ValidArrowMap[P] : never interface TooltipProps
{ heading?: string text?: string position: P arrow: ValidArrow
isTouchable?: boolean isVisible?: boolean } export function Tooltip
({
heading,
text,
position,
arrow,
children,
isTouchable = false,
isVisible = true,
}: PropsWithChildren {heading} {text}