You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PopoverComponent.js 651B

1234567891011121314151617181920212223242526272829303132
  1. import React from "react";
  2. import PropTypes from "prop-types";
  3. import { Popover } from "@mui/material";
  4. const PopoverComponent = ({ open, anchorEl, onClose, content }) => {
  5. const handleClose = () => {
  6. onClose();
  7. };
  8. return (
  9. <Popover
  10. open={open}
  11. anchorEl={anchorEl}
  12. onClose={handleClose}
  13. anchorOrigin={{
  14. vertical: "bottom",
  15. horizontal: "left",
  16. }}
  17. >
  18. {content}
  19. </Popover>
  20. );
  21. };
  22. PopoverComponent.propTypes = {
  23. anchorEl: PropTypes.object,
  24. open: PropTypes.bool.isRequired,
  25. onClose: PropTypes.func.isRequired,
  26. content: PropTypes.any,
  27. };
  28. export default PopoverComponent;