import e, { useState as f, useRef as p, useEffect as m } from "react";
import a from "./accelbyte-widgets498.mjs";
import n from "react-tooltip";
const E = ({ text: i, children: o, showOnlyOnEllipsis: r = !1 }) => {
  const [s, c] = f(!1), l = p(null);
  return m(() => {
    const t = l.current;
    t && c(t.scrollWidth > t.clientWidth);
  }, []), /* @__PURE__ */ e.createElement("div", { className: a.tooltipContainer }, /* @__PURE__ */ e.createElement(
    "div",
    {
      "data-tip": i,
      "data-for": "tooltip",
      "data-event": "mouseenter",
      "data-event-off": "mouseleave"
    },
    o && e.cloneElement(o, { className: a.tooltipContent, ref: l })
  ), r ? s && /* @__PURE__ */ e.createElement(n, { id: "tooltip", effect: "solid", place: "top" }) : /* @__PURE__ */ e.createElement(n, { id: "tooltip", effect: "solid", place: "top" }));
};
export {
  E as Tooltip
};
