import React, { useState } from 'react';
import { Popover, Button, Box } from '@mui/material';
import { executeEvent } from '../utils/events';
export const WrapperUserAction = ({ children, address, name, disabled }) => {
const [anchorEl, setAnchorEl] = useState(null);
// Handle child element click to open Popover
const handleChildClick = (event) => {
event.stopPropagation(); // Prevent parent onClick from firing
setAnchorEl(event.currentTarget);
};
// Handle closing the Popover
const handleClose = () => {
setAnchorEl(null);
};
// Determine if the popover is open
const open = Boolean(anchorEl);
const id = open ? address || name : undefined;
if(disabled){
return children
}
return (
<>
{/* Render the child without altering dimensions */}
{children}
{/* Popover */}
event.stopPropagation(), // Stop propagation inside popover
},
}}
>
{/* Option 1: Message */}
{/* Option 2: Send QORT */}
>
);
};