// ** React Imports import { MouseEvent, useState } from 'react' // ** MUI Imports import List from '@mui/material/List' import Menu from '@mui/material/Menu' import ListItem from '@mui/material/ListItem' import MenuItem from '@mui/material/MenuItem' import ListItemText from '@mui/material/ListItemText' import ListItemButton from '@mui/material/ListItemButton' const options = [ 'Show some love to MUI', 'Show all notification content', 'Hide sensitive notification content', 'Hide all notification content' ] const MenuSelected = () => { // ** State const [selectedIndex, setSelectedIndex] = useState(1) // ** Ref const [anchorEl, setAnchorEl] = useState(null) const handleClickListItem = (event: MouseEvent) => { setAnchorEl(event.currentTarget) } const handleMenuItemClick = (event: MouseEvent, index: number) => { setAnchorEl(null) setSelectedIndex(index) } const handleClose = () => { setAnchorEl(null) } return (
{options.map((option, index) => ( handleMenuItemClick(event, index)} > {option} ))}
) } export default MenuSelected