import React, { Component } from 'react';
import Feed from '../feed/Feed';
import {
  getFeedContentFromState,
  getFeedLoadingFromState,
  getFeedHasMoreFromState
} from '../helpers/stateHelpers';
import EmptyFeed from '../statics/EmptyFeed';

export default class UserProfileFeed extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    const { feed, posts, getUserFeedContent, getMoreUserFeedContent } = this.props;
    const username = this.props.params.name;

    const content = getFeedContentFromState('feed', username, feed, posts);
    const isFetching = getFeedLoadingFromState('feed', username, feed);
    const hasMore = getFeedHasMoreFromState('feed', username, feed);
    const loadContentAction = () => getUserFeedContent({
      sortBy: 'feed',
      username,
      limit: this.props.limit,
    });
    const loadMoreContentAction = () => getMoreUserFeedContent({
      sortBy: 'feed',
      username,
      limit: this.props.limit,
    });

    return (
      <di>
        <Feed
          content={content}
          isFetching={isFetching}
          hasMore={hasMore}
          loadContent={loadContentAction}
          loadMoreContent={loadMoreContentAction}
          route={this.props.route}
        />

        { (content.length === 0 && !isFetching) &&
          <EmptyFeed />
        }
      </di>
    );
  }
}

@@ -1000,16 +1000,17 @@
      %3Cdi
+v
 %3E%0A      
@@ -1341,16 +1341,17 @@
     %3C/di
+v
 %3E%0A    );

fix typo in div element