import { ReactNode } from "react"; export interface TooltipProps { /** * Tooltip text - can be string or another component */ tooltipMessage: ReactNode; /** * The targeted component */ children: ReactNode; } const Tooltip = ({ tooltipMessage, children }: TooltipProps) => { return (
{/* Tooltip will be shown under the component(children) when the children is onHover */} {children} {/* Creating the tooltip and give it a postion */}
{tooltipMessage}
); }; export default Tooltip;