All files / components/post comment.jsx

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34          1x                           1x           1x                
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;