import cn from 'classnames'; import { Popup } from 'UI'; import styles from './textEllipsis.css'; const TextEllipsis = ({ text, hintText = text, children, maxWidth="auto", style = {}, className="", noHint=false, popupProps={}, hintProps={}, ...props }) => { const textOrChildren = text || children; const trigger = (
{ textOrChildren }
); if (noHint) return trigger; return ( { hintText || textOrChildren } } { ...popupProps } /> ); }; TextEllipsis.displayName ="TextEllipsis"; export default TextEllipsis;