import React from "react"; import { Tooltip2 } from "@blueprintjs/popover2"; export type Props = { tooltipHeading?: string; tooltipContent: string; position?: "top" | "right" | "bottom" | "left"; children: JSX.Element; disabled?: boolean; }; export const Tooltip: React.FC = ({ tooltipHeading, tooltipContent, position = "top", children, disabled = false, }) => { return ( {tooltipHeading ? ( <>
{tooltipHeading}

{tooltipContent}

) : (

{tooltipContent}

)} } position={position} renderTarget={({ isOpen: isTooltipOpen, ref: eleRefernce, ...tooltipProps }) => React.cloneElement(children, { ref: eleRefernce, ...tooltipProps, ...children.props }) } /> ); };