diff --git a/packages/grafana-ui/src/components/IconButton/IconButton.tsx b/packages/grafana-ui/src/components/IconButton/IconButton.tsx index 43c000d9d94..c52de18b45b 100644 --- a/packages/grafana-ui/src/components/IconButton/IconButton.tsx +++ b/packages/grafana-ui/src/components/IconButton/IconButton.tsx @@ -5,7 +5,7 @@ import { stylesFactory } from '../../themes/stylesFactory'; import { css, cx } from '@emotion/css'; import { useTheme2 } from '../../themes/ThemeContext'; import { GrafanaTheme2, colorManipulator } from '@grafana/data'; -import { Tooltip } from '../Tooltip/Tooltip'; +import { PopoverContent, Tooltip } from '../Tooltip/Tooltip'; import { TooltipPlacement } from '../Tooltip/PopoverController'; import { getFocusStyles, getMouseFocusStyles } from '../../themes/mixins'; @@ -21,7 +21,7 @@ export interface Props extends React.ButtonHTMLAttributes { /** Type od the icon - mono or default */ iconType?: IconType; /** Tooltip content to display on hover */ - tooltip?: string; + tooltip?: PopoverContent; /** Position of the tooltip */ tooltipPlacement?: TooltipPlacement; /** Variant to change the color of the Icon */ @@ -49,9 +49,10 @@ export const IconButton = React.forwardRef( ) => { const theme = useTheme2(); const styles = getStyles(theme, size, variant); + const tooltipString = typeof tooltip === 'string' ? tooltip : ''; const button = ( - ); diff --git a/packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.tsx b/packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.tsx index a9cb129e9fc..75536701d35 100644 --- a/packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.tsx +++ b/packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.tsx @@ -1,15 +1,11 @@ import React from 'react'; -import { Tooltip, TooltipProps, PopoverContent } from '../Tooltip/Tooltip'; -import { Icon } from '../Icon/Icon'; +import { PopoverContent, TooltipProps } from '../Tooltip/Tooltip'; +import { IconButton } from '../IconButton/IconButton'; interface InfoTooltipProps extends Omit { children: PopoverContent; } export const InfoTooltip = ({ children, ...restProps }: InfoTooltipProps) => { - return ( - - - - ); + return ; };