import React from "react"; import { Box, Tooltip, Portal, Backdrop } from "@mui/material"; import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined"; const InfoIconWithTooltip = ({ tooltip, iconProps = {}, sx = {} }) => { const [open, setOpen] = React.useState(false); return ( <> setOpen(true)} onClose={() => setOpen(false)} componentsProps={{ tooltip: { sx: { bgcolor: "rgba(33, 33, 33, 0.95)", padding: "12px 16px", maxWidth: "none !important", width: "auto", minWidth: "200px", fontSize: "0.875rem", lineHeight: 1.5, position: "relative", zIndex: 1501, "& .MuiTooltip-arrow": { color: "rgba(33, 33, 33, 0.95)", }, }, }, popper: { sx: { zIndex: 1501, maxWidth: "min(600px, 90vw) !important", '&[data-popper-placement*="bottom"] .MuiTooltip-tooltip': { marginTop: "10px", }, '&[data-popper-placement*="top"] .MuiTooltip-tooltip': { marginBottom: "10px", }, }, }, }} > {open && ( )} ); }; export default InfoIconWithTooltip;