mirror of
https://github.com/wassname/talk.git
synced 2026-07-08 11:43:16 +08:00
28 lines
754 B
JavaScript
28 lines
754 B
JavaScript
import React, {PropTypes} from 'react';
|
|
import Comment from './Comment';
|
|
import styles from './CommentHistory.css';
|
|
|
|
const CommentHistory = props => {
|
|
return (
|
|
<div className={`${styles.header} commentHistory`}>
|
|
<div className="commentHistory__list">
|
|
{props.comments.map((comment, i) => {
|
|
const asset = props.assets.find(asset => asset.id === comment.asset_id);
|
|
return <Comment
|
|
key={i}
|
|
comment={comment}
|
|
link={props.link}
|
|
asset={asset} />;
|
|
})}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
CommentHistory.propTypes = {
|
|
comments: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
assets: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
};
|
|
|
|
export default CommentHistory;
|