2024-05-09 13:37:11 +03:30
|
|
|
import "./tooltipWithTail.css";
|
|
|
|
|
import React from "react";
|
|
|
|
|
import { styled } from "@mui/material/styles";
|
2024-05-15 08:40:41 +03:30
|
|
|
import Tooltip, { tooltipClasses } from "@mui/material/Tooltip";
|
2024-05-09 13:37:11 +03:30
|
|
|
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
|
|
|
|
|
|
|
|
|
|
const CustomizedTooltip = styled(
|
2024-05-15 08:40:41 +03:30
|
|
|
({ className, placement, arrow, ...props }) => (
|
2024-05-09 13:37:11 +03:30
|
|
|
<Tooltip
|
|
|
|
|
{...props}
|
|
|
|
|
placement={placement}
|
|
|
|
|
arrow={arrow}
|
|
|
|
|
classes={{ popper: className }}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
)(({ theme }) => ({
|
|
|
|
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
|
|
|
backgroundColor: "black",
|
|
|
|
|
},
|
|
|
|
|
[`& .${tooltipClasses.arrow}`]: {
|
|
|
|
|
color: "black",
|
|
|
|
|
},
|
|
|
|
|
}));
|
|
|
|
|
|
2024-05-15 08:18:33 +03:30
|
|
|
function TooltipWithTail({ placement, arrow = false, title, text }) {
|
2024-05-09 13:37:11 +03:30
|
|
|
return (
|
2024-05-15 08:18:33 +03:30
|
|
|
<div>
|
2024-05-09 13:37:11 +03:30
|
|
|
<CustomizedTooltip
|
|
|
|
|
arrow={arrow}
|
|
|
|
|
placement={placement}
|
|
|
|
|
title={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{title && <div className="tooltip-title">{title}</div>}
|
|
|
|
|
<div className="tooltip-description">{text}</div>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
}
|
|
|
|
|
className="tooltip-holder"
|
|
|
|
|
>
|
|
|
|
|
<HelpOutlineIcon style={{ fill: "#98A2B3" }} />
|
|
|
|
|
</CustomizedTooltip>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-05-15 08:18:33 +03:30
|
|
|
}
|
2024-05-09 13:37:11 +03:30
|
|
|
|
|
|
|
|
export default TooltipWithTail;
|