import React from 'react' ; import IconButton from '@material-ui/core/IconButton' ; import MoreVertIcon from '@material-ui/icons/MoreVert' ; import Menu from '@material-ui/core/Menu' ; interface Props { children : React . ReactNode ; } export function IconMenu ( props ) { const [ anchorEl , setAnchorEl ] = React . useState < null | HTMLElement > ( null ) ; const handleClick = ( event ) => { setAnchorEl ( event . currentTarget ) ; } ; const handleClose = ( ) => { setAnchorEl ( null ) ; } ; return ( < div > < IconButton aria - controls = "icon-menu" aria - haspopup = "true" onClick = { handleClick } > < MoreVertIcon /> < /IconButton> < Menu id = "icon-menu" anchorEl = { anchorEl } keepMounted open = { Boolean ( anchorEl ) } onClose = { handleClose } > < div onClick = { handleClose } > { props . children } < /div> < /Menu> < /div>); }