// @ts-check import React from 'react'; import { Sparklines, SparklinesCurve } from 'react-sparklines'; import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import Permalink from './permalink'; import ShortNumber from 'mastodon/components/short_number'; class SilentErrorBoundary extends React.Component { static propTypes = { children: PropTypes.node, }; state = { error: false, }; componentDidCatch () { this.setState({ error: true }); } render () { if (this.state.error) { return null; } return this.props.children; } } /** * Used to render counter of how much people are talking about hashtag * * @type {(displayNumber: JSX.Element, pluralReady: number) => JSX.Element} */ const accountsCountRenderer = (displayNumber, pluralReady) => ( {displayNumber}, }} /> ); const Hashtag = ({ hashtag }) => (
#{hashtag.get('name')}
day.get('uses')) .toArray()} >
); Hashtag.propTypes = { hashtag: ImmutablePropTypes.map.isRequired, }; export default Hashtag;