import{__assign as i,__rest as e}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as r}from"react/jsx-runtime";import{useState as o,useRef as t,useEffect as l}from"react";import{makeStyles as a,Tooltip as n}from"@material-ui/core";import s from"classnames";var c=a({root:function(e){var r=e.maxLines;return i({overflow:"hidden"},r?{display:"-webkit-box","-webkit-line-clamp":r,"-webkit-box-orient":"vertical"}:{whiteSpace:"nowrap",textOverflow:"ellipsis"})}});function m(a){var m=a.children,d=a.className,p=void 0===d?"":d,f=a.maxLines,h=void 0===f?null:f,v=a.showTooltip,u=void 0===v||v,w=e(a,["children","className","maxLines","showTooltip"]),x=o(!1),b=x[0],L=x[1],k=t(),N=c({maxLines:h});l((function(){var i=k.current,e=i.scrollWidth,r=i.clientWidth,o=i.scrollHeight,t=i.clientHeight;L(h?o>t:e>r)}));var g=r("div",i({className:s(N.root,p),ref:k},w,{children:m}));return b&&u?r(n,i({title:m},{children:g})):g}export{m as default};
