// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; import { Menu, IconButton } from '@material-ui/core'; import { PopoverOrigin } from '@material-ui/core/Popover'; interface DropdownMenuProps { id: string; icon: React.ComponentType; } class DropdownMenu extends React.Component { state = { anchorEl: undefined }; transformOrigin: PopoverOrigin = { vertical: "top", horizontal: "center" }; render() { const { icon: Icon, id, children } = this.props; const { anchorEl } = this.state; return (
{children}
); } handleClose = () => { this.setState({ anchorEl: undefined }); } handleOpen = (event: React.MouseEvent) => { this.setState({ anchorEl: event.currentTarget }); } } export default DropdownMenu;