import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; import api from 'mastodon/api'; import { Hashtag } from 'mastodon/components/hashtag'; export default class Trends extends PureComponent { static propTypes = { limit: PropTypes.number.isRequired, }; state = { loading: true, data: null, }; componentDidMount () { const { limit } = this.props; api(false).get('/api/v1/admin/trends/tags', { params: { limit } }).then(res => { this.setState({ loading: false, data: res.data, }); }).catch(err => { console.error(err); }); } render () { const { limit } = this.props; const { loading, data } = this.state; let content; if (loading) { content = (