import { jsx as r } from "react/jsx-runtime";
import { Typography as i, Tooltip as u } from "@mui/material";
import { useMemo as l } from "react";
function p(e, o = 10) {
  return e ? e.length <= o ? e : `${e.slice(0, o - 1)}...${e.slice(-2)}` : "";
}
function s({ children: e, maxLength: o = 10, sx: t = void 0, hiddenTip: f = !1 }) {
  const n = l(() => p(e, o), [e, o]);
  return e?.length <= o ? /* @__PURE__ */ r(i, { sx: t, children: e }) : f ? /* @__PURE__ */ r(i, { sx: t, children: n }) : /* @__PURE__ */ r(u, { title: e, placement: "top", children: /* @__PURE__ */ r(i, { sx: t, children: n }) });
}
export {
  s as default
};
