{"size": 1149, "ext": "js", "max_stars_repo_path": "src/components/Article/CommentContainer.js", "max_stars_repo_name": "ttnguyen89/react-compte-project", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Article/CommentContainer.js", "max_issues_repo_name": "ttnguyen89/react-compte-project", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Article/CommentContainer.js", "max_forks_repo_name": "ttnguyen89/react-compte-project", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.8285714286, "max_line_length": 87, "alphanum_fraction": 0.5117493473}
import CommentInput from './CommentInput';
import CommentList from "./CommentList";
import { Link } from "react-router-dom";
import React from "react";

const CommentContainer = (props) => {
    if(props.currentUser) {
        return (
            <div className='col-xs-12 col-md-8 offset-md-2'>
                <div>
                    <list-errors errors={props.errors}/>
                    <CommentInput slug={props.slug} currentUser = {props.currentUser}/>
                </div>

                <CommentList comments = {props.comments}
                    slug={props.slug}
                    currentUser={props.currentUser}/>
            </div>
        );
    } else {
        <div className = 'col-xs-12 col-md-8 offset-md-2'>
            <p>
                <Link to='/login'>Sign in</Link>
                &nbsp;or&nbsp;
                <Link to='/register'>Register</Link>
                &nbsp;toadd comment on this article.
            </p>
            <CommentList comments={props.comments}
                slug={props.slug}
                currentUser={props.currentUser}/>
        </div>
    }
}

export default CommentContainer;