import { useAppState } from '../../Application' ; import Selectors from '../../selectors' ; import { handleEdit } from '../../actions' ; import { asyncMoveUp , asyncMoveDown , asyncUpdateBlock , asyncDestroyBlock } from '../../async-actions' ; import BlockConfigMenu from './block-config-menu' ; export default ( properties ) : React . ReactElement => { const { state , dispatch } = useAppState ( ) ; const selectors = Selectors ( state , properties ) ; const configMenuProperites = { canMoveUp : selectors . canMoveUp ( ) , canMoveDown : selectors . canMoveDown ( ) , moveUp : asyncMoveUp ( dispatch , state ) , moveDown : asyncMoveDown ( dispatch , state ) , update : asyncUpdateBlock ( dispatch ) , onEdit : handleEdit ( dispatch ) , destroy : asyncDestroyBlock ( dispatch ) } ; return < BlockConfigMenu { ... properties } { ... configMenuProperites } />; } ;