import React from 'react' import PropTypes from 'prop-types' import ImmutablePureComponent from 'react-immutable-pure-component' import ImmutablePropTypes from 'react-immutable-proptypes' import { urlRegex } from '../features/ui/util/url_regex' import { DEFAULT_REL } from '../constants' import Button from './button' import DotTextSeperator from './dot_text_seperator' import RelativeTimestamp from './relative_timestamp' import Text from './text' class TrendsItem extends ImmutablePureComponent { render() { const { trend } = this.props if (!trend) return null const title = trend.get('title') const url = trend.get('trends_url') if (!title || !url) return null let correctedDescription = trend.get('description') correctedDescription = correctedDescription.length >= 120 ? `${correctedDescription.substring(0, 120).trim()}...` : correctedDescription const descriptionHasLink = correctedDescription.match(urlRegex) return ( ) } } TrendsItem.propTypes = { trend: ImmutablePropTypes.map, } export default TrendsItem