MCPcopy Create free account
hub / github.com/OpenSignLabs/OpenSign / Tooltip

Function Tooltip

apps/OpenSign/src/primitives/Tooltip.jsx:4–51  ·  view source on GitHub ↗
({
  id,
  message,
  url,
  iconColor,
  maxWidth,
  handleOnlickHelp
})

Source from the content-addressed store, hash-verified

2import { Tooltip as ReactTooltip } from "react-tooltip";
3import { openInNewTab } from "../constant/Utils";
4const Tooltip = ({
5 id,
6 message,
7 url,
8 iconColor,
9 maxWidth,
10 handleOnlickHelp
11}) =>
12 url || handleOnlickHelp ? (
13 <button
14 onClick={() =>
15 handleOnlickHelp ? handleOnlickHelp() : openInNewTab(url)
16 }
17 className="text-center cursor-pointer focus:outline-none"
18 >
19 <sup>
20 <i
21 className="fa-light fa-question rounded-full border-[1px] py-[1.5px] px-[4px] text-[13px]"
22 style={{
23 borderColor: iconColor ? iconColor : "#33bbff",
24 color: iconColor ? iconColor : "#33bbff"
25 }}
26 ></i>
27 </sup>
28 </button>
29 ) : (
30 <>
31 <a
32 data-tooltip-id={id ? id : "my-tooltip"}
33 data-tooltip-content={message}
34 className="z-50"
35 >
36 <sup>
37 <i
38 className="fa-light fa-question rounded-full border-[1px] py-[1.5px] px-[4px] text-[13px]"
39 style={{
40 borderColor: iconColor ? iconColor : "#33bbff",
41 color: iconColor ? iconColor : "#33bbff"
42 }}
43 ></i>
44 </sup>
45 </a>
46 <ReactTooltip
47 id={id ? id : "my-tooltip"}
48 className={`${maxWidth ? maxWidth : "max-w-[200px]"} z-[200]`}
49 />
50 </>
51 );
52
53export default Tooltip;

Callers

nothing calls this directly

Calls 1

openInNewTabFunction · 0.90

Tested by

no test coverage detected