import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import ImmutablePureComponent from 'react-immutable-pure-component' import ImmutablePropTypes from 'react-immutable-proptypes' import { defineMessages, injectIntl } from 'react-intl' import { fetchRelatedSuggestions } from '../actions/suggestions' import Account from '../components/account' import ScrollableList from '../components/scrollable_list' import Block from '../components/block' import BlockHeading from '../components/block_heading' import AccountPlaceholder from '../components/placeholder/account_placeholder' class Suggestions extends ImmutablePureComponent { componentDidMount() { this.props.fetchRelatedSuggestions() } render() { const { intl, isLoading, suggestions, } = this.props return ( { suggestions && suggestions.map((id) => ( )) } ) } } const mapStateToProps = (state) => ({ suggestions: state.getIn(['suggestions', 'related', 'items']), isLoading: state.getIn(['suggestions', 'related', 'isLoading']), }) const mapDispatchToProps = (dispatch) => ({ fetchRelatedSuggestions: () => dispatch(fetchRelatedSuggestions(true)), }) const messages = defineMessages({ title: { id: 'who_to_follow.title', defaultMessage: 'Who to Follow' }, empty: { id: 'account.suggestions.empty', defaultMessage: 'No suggestions found.' }, }) Suggestions.propTypes = { intl: PropTypes.object.isRequired, fetchRelatedSuggestions: PropTypes.func.isRequired, suggestions: ImmutablePropTypes.list.isRequired, isLoading: PropTypes.bool, } export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Suggestions))