import { css } from '@emotion/css'; import React, { useState } from 'react'; import { usePopperTooltip } from 'react-popper-tooltip'; import { GrafanaTheme2, renderMarkdown } from '@grafana/data'; import { FlexItem } from '@grafana/experimental'; import { Button, Portal, useStyles2 } from '@grafana/ui'; import { QueryBuilderOperation, QueryBuilderOperationDef } from './types'; export interface Props { operation: QueryBuilderOperation; def: QueryBuilderOperationDef; } export const OperationInfoButton = React.memo(({ def, operation }) => { const styles = useStyles2(getStyles); const [show, setShow] = useState(false); const { getTooltipProps, setTooltipRef, setTriggerRef, visible } = usePopperTooltip({ placement: 'top', visible: show, offset: [0, 16], onVisibleChange: setShow, interactive: true, trigger: ['click'], }); return ( <>