2018-03-26 14:32:43 -07:00
|
|
|
// @flow
|
|
|
|
import * as React from 'react';
|
|
|
|
|
|
|
|
type Props = {
|
2018-09-24 19:08:24 -04:00
|
|
|
text: string,
|
|
|
|
lines: number,
|
2018-03-26 14:32:43 -07:00
|
|
|
};
|
|
|
|
|
2018-04-18 00:03:01 -04:00
|
|
|
const TruncatedText = (props: Props) => (
|
2018-09-24 19:08:24 -04:00
|
|
|
<span title={props.text} className="truncated-text" style={{ WebkitLineClamp: props.lines }}>
|
|
|
|
{props.text}
|
2018-04-18 00:03:01 -04:00
|
|
|
</span>
|
|
|
|
);
|
2018-03-26 14:32:43 -07:00
|
|
|
|
|
|
|
export default TruncatedText;
|