import React from "react"; import uniqueId from "lodash/uniqueId"; import InfoReactSvgUrl from "PUBLIC_DIR/images/info.react.svg?url"; import { classNames } from "../../utils"; import { IconButton } from "../icon-button"; import { Tooltip } from "../tooltip"; import { HelpButtonProps } from "./HelpButton.types"; const HelpButton = (props: HelpButtonProps) => { const { id, className, iconName, size, color, dataTip, getContent, place, offset, style, afterShow, afterHide, tooltipMaxWidth, tooltipContent, } = props; const currentId = id || uniqueId(); const ref = React.useRef(null); const anchorSelect = `div[id='${currentId}'] svg`; return (
{getContent ? ( ) : ( {tooltipContent} )}
); }; HelpButton.defaultProps = { iconName: InfoReactSvgUrl, // place: "top", className: "icon-button", size: 12, }; export { HelpButton };