import { useAppState } from '../../Application' ; import WidgetOverlay from './widget-overlay' ; import Selectors from '../../selectors' ; import { handleMouseOver , handleMouseOut } from '../../actions' ; export default ( properties ) : React . ReactElement => { const { state , dispatch } = useAppState ( ) ; const selectors = Selectors ( state , properties ) ; const overlayProperties = { hasMouseOver : selectors . hasMouseOver ( 'widget' , properties . widget . id ) , onMouseOver : handleMouseOver ( dispatch ) , onMouseOut : handleMouseOut ( dispatch ) } ; return < WidgetOverlay { ... properties } { ... overlayProperties } />; } ;