import React from 'react'; import { Link } from 'react-router-dom'; import PostEditButton from './post_edit_button'; import CommentIndexContainer from '../comments/comment_index_container'; import CreateCommentFormContainer from '../comments/create_comment_form_container'; class PostIndexItem extends React.Component { postRecipient(author, recipient) { if (author !== recipient) { return {recipient.fname} {recipient.lname} ; } } renderImages() { // if (this.props.post.imageUrls) { // return this.props.post.imageUrls.map( // (url, idx) => // ); // } else { // return null; // } if (this.props.post.imageUrl) { return } else { return null; } } render() { const { author, recipient, post } = this.props; return (
{author.fname} {author.lname} {this.postRecipient(author, recipient)}
{post.createdAt}
{post.body} {this.renderImages()}
); } } export default PostIndexItem;