mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
20 lines
718 B
JavaScript
20 lines
718 B
JavaScript
import { Components, registerComponent } from 'meteor/vulcan:core';
|
|
import React, { PureComponent } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
const CommentsNode = ({ comment, currentUser }) =>
|
|
<div className="comments-node">
|
|
<Components.CommentsItem currentUser={currentUser} comment={comment} key={comment._id} />
|
|
{comment.childrenResults ?
|
|
<div className="comments-children">
|
|
{comment.childrenResults.map(comment => <CommentsNode currentUser={currentUser} comment={comment} key={comment._id} />)}
|
|
</div>
|
|
: null
|
|
}
|
|
</div>
|
|
|
|
CommentsNode.propTypes = {
|
|
comment: PropTypes.object.isRequired, // the current comment
|
|
};
|
|
|
|
registerComponent('CommentsNode', CommentsNode);
|