import React , { useState } from 'react' ; import { EuiExpression , EuiPopover } from '@elastic/eui' ; interface Props { title : React . ReactNode ; value : React . ReactNode ; children ? : React . ReactNode ; } export function PopoverExpression ( props ) { const { title , value , children } = props ; const [ popoverOpen , setPopoverOpen ] = useState ( false ) ; return ( < EuiPopover isOpen = { popoverOpen } anchorPosition = "downLeft" closePopover = { ( ) => setPopoverOpen ( false ) } button = { < EuiExpression description = { title } value = { value } isActive = { popoverOpen } onClick = { ( ) => setPopoverOpen ( true ) } />} repositionOnScroll> { children } < /EuiPopover>); }