import React from 'react'; import { ListItemIcon, ListItemText, Slide, makeStyles, Paper, } from '@material-ui/core'; import { List } from './List'; import { ListItem } from './ListItem'; const useStyles = makeStyles((theme) => ({ root: { width: '100%', position: 'absolute', bottom: 0, zIndex: 2, }, })); interface IContextMenuProps { open: boolean; onClose(): void; options: Array<{ onClick(e, option): void; label: string; selected?: boolean; icon?: React.ReactNode; key?: string; }>; } export const ContextMenu = ({ open, onClose, options }: IContextMenuProps) => { const classes = useStyles(); return ( {options.map((option) => ( { option.onClick(e, option); onClose(); }} > {option.icon && {option.icon}} ))} ); };