import React from 'react';
import PropTypes from 'prop-types';
class Comment extends React.Component {
render() {
return (
<div className="box-comment">
<img className="img-circle img-sm" src={this.props.img} alt="User image" />
<div className="comment-text">
<span className="username">
{this.props.name}
<span className="text-muted pull-right">{this.props.date}</span>
</span>
{this.props.content}
</div>
</div>
);
}
}
Comment.propTypes = {
content: PropTypes.string,
name: PropTypes.string,
img: PropTypes.string,
date: PropTypes.string
};
Comment.defaultProps = {
content: '',
name: '',
img: '',
date: ''
};
export default Comment;
|