packages/typography/src/views/Ellipsis.js
function Ellipsis({ children, title, tag, ...other }) {
  const CustomTagEllipsis = StyledEllipsis.withComponent(tag);

  let textContent = null;

  if (title !== undefined) {
    textContent = title;
  } else if (typeof children === 'string') {
    textContent = children;
  }

  return (
    <CustomTagEllipsis title={textContent} {...other}>
      {children}
    </CustomTagEllipsis>
  );
}
function Ellipsis({ children, title, tag, ...other }) {
  const CustomTagEllipsis = StyledEllipsis.withComponent(tag);

  let textContent = null;

  if (title !== undefined) {
    textContent = title;
  } else if (typeof children === 'string') {
    textContent = children;
  }

  return (
    <CustomTagEllipsis title={textContent} {...other}>
      {children}
    </CustomTagEllipsis>
  );
}
function Ellipsis ( { children , title , tag , ... other } ) { const CustomTagEllipsis = StyledEllipsis . withComponent ( tag ) ; let textContent = null ; if ( title !== undefined ) { textContent = title ; } else if ( typeof children === 'string' ) { textContent = children ; } return ( < CustomTagEllipsis title = { textContent } { ... other } > { children } < / CustomTagEllipsis > ) ; }
A component that automatically includes a native `title` attribute
and any text-overflow styling.

All other props are spread onto the element.

@param {*} props
A component that automatically includes a native title attribute and any text - overflow styling .