import {
  Tooltip,
  TooltipContent,
  TooltipProvider,
  TooltipTrigger
} from "./chunk-KT4BIOJJ.js";
import {
  Button
} from "./chunk-Q5AFRGVP.js";
import {
  __objRest
} from "./chunk-N552FDTV.js";

// src/atoms/ellipsis-tooltip.tsx
import { useEffect, useRef, useState } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
function EllipsisTooltip(props) {
  const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
  const ref = useRef(null);
  const [tooltipDisplay, setTooltipDisplay] = useState(
    "none"
  );
  useEffect(() => {
    if (ref.current) {
      const typo = ref.current;
      const mouseOver = () => {
        if (typo.clientHeight < typo.scrollHeight) {
          setTooltipDisplay("block");
        }
      };
      const mouseOut = () => {
        setTooltipDisplay("none");
      };
      ref.current.addEventListener("mouseenter", mouseOver);
      ref.current.addEventListener("mouseleave", mouseOut);
    }
  }, [children]);
  return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
    /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { children: "?" }) }),
    /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "\uD234\uD301 \uB0B4\uC6A9" }) })
  ] }) });
}

export {
  EllipsisTooltip
};
//# sourceMappingURL=chunk-TBEOWECF.js.map