<commit_before>import React, { Component, PropTypes } from 'react';
import { generateTreeStructure } from 'app/utils';
import LoadingIndicator from 'app/components/LoadingIndicator';
import CommentTree from './CommentTree';
import CommentForm from 'app/components/CommentForm';

export default class CommentView extends Component {
  static propTypes = {
    comments: PropTypes.array,
    formDisabled: PropTypes.bool,
    commentTarget: PropTypes.string.isRequired,
    user: PropTypes.object.isRequired,
    loggedIn: PropTypes.bool.isRequired
  };

  render() {
    const { comments, formDisabled, commentTarget, user, loggedIn } = this.props;
    const commentFormProps = { commentTarget, user, loggedIn };
    const tree = generateTreeStructure(comments);
    return (
      <div>
        <h3>Diskusjon</h3>
        <LoadingIndicator loading={!comments}>
          {comments && <CommentTree comments={tree} commentFormProps={commentFormProps} />}
        </LoadingIndicator>

        {!formDisabled ? (
          <div>
            <h3>Ta del i diskusjonen eller få svar på dine spørsmål</h3>
            <CommentForm {...commentFormProps} />
          </div>
        ) : null}
      </div>
    );
  }
}<commit_msg>Show different text when there are no comments<commit_after>import React, { Component, PropTypes } from 'react';
import { generateTreeStructure } from 'app/utils';
import LoadingIndicator from 'app/components/LoadingIndicator';
import CommentTree from './CommentTree';
import CommentForm from 'app/components/CommentForm';

export default class CommentView extends Component {
  static propTypes = {
    comments: PropTypes.array,
    formDisabled: PropTypes.bool,
    commentTarget: PropTypes.string.isRequired,
    user: PropTypes.object.isRequired,
    loggedIn: PropTypes.bool.isRequired
  };

  render() {
    const { comments, formDisabled, commentTarget, user, loggedIn } = this.props;
    const commentFormProps = { commentTarget, user, loggedIn };
    const tree = generateTreeStructure(comments);
    return (
      <div>
        {comments.length ? <h3>Diskusjon</h3> : null}
        <LoadingIndicator loading={!comments}>
          {comments && <CommentTree comments={tree} commentFormProps={commentFormProps} />}
        </LoadingIndicator>

        {!formDisabled ? (
          <div>
            <h3>{comments.length
              ? 'Ta del i diskusjonen eller få svar på dine spørsmål'
              : 'Start en diskusjon eller still et spørsmål'
            }</h3>
            <CommentForm {...commentFormProps} />
          </div>
        ) : null}
      </div>
    );
  }
}
{'fraction_non_alphanumeric': 0.1103448275862069, 'fraction_numerical': 0.0030651340996168583, 'mean_word_length': 3.0231124807395995, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4026269', 'n_tokens_mistral': 715, 'n_tokens_neox': 729, 'n_words': 184}