import React from 'react'; import PropTypes from 'prop-types'; import api from 'mastodon/api'; import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; import Hashtag from 'mastodon/components/hashtag'; export default class Trends extends React.PureComponent { static propTypes = { limit: PropTypes.number.isRequired, }; state = { loading: true, data: null, }; componentDidMount () { const { limit } = this.props; api().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 = (