<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
// components
import DefaultArea from './DefaultArea';
import SelectionArea from './SelectionArea';
import InstructionsArea from './InstructionsArea';
import EditVerseArea from './EditVerseArea';
import CommentArea from './CommentArea';
import style from '../css/Style';
class CheckArea extends Component {
  render() {
    const {
      actions,
      mode,
      tags,
      verseText,
      verseChanged,
      comment,
      contextIdReducer,
      selectionsReducer,
      projectDetailsReducer
    } = this.props;
    let modeArea;
    switch (mode) {
      case 'edit':
        modeArea = (
          <EditVerseArea
            tags={tags}
            verseText={verseText}
            verseChanged={verseChanged}
            actions={actions}
            dir={projectDetailsReducer.manifest.target_language.direction}
          />
        );
        break;
      case 'comment':
        modeArea = <CommentArea comment={comment} actions={actions} />;
        break;
      case 'select':
        modeArea = (
          <div style={{ WebkitUserSelect: 'none', display: "flex", flex: "1", justifyContent: "center", alignItems: "center", overflow: "auto" }}>
            <InstructionsArea
              verseText={verseText}
              selectionsReducer={selectionsReducer}
              quote={contextIdReducer.contextId.quote}
              mode={mode}
            />
          </div>);
        break;
      case 'default':
      default:
        modeArea = (
          <div style={{ WebkitUserSelect: 'none', display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }}>
            <InstructionsArea dontShowTranslation={true} verseText={verseText} selectionsReducer={selectionsReducer} quote={contextIdReducer.contextId.quote} />
          </div>
        );
    }

    return (
      <div style={style.checkArea}>
        {mode === 'select' ?
          <SelectionArea
            {...this.props}
            actions={actions}
            quote={contextIdReducer.contextId.quote}
          /> :
          <DefaultArea {...this.props} />}
        <div style={{ borderLeft: '1px solid var(--border-color)', flex: 1, overflowY: "auto", display:'flex', justifyContent:'center' }}>
          {modeArea}
        </div>
      </div>
    );
  }
}

CheckArea.propTypes = {
  actions: PropTypes.object.isRequired,
  mode: PropTypes.string.isRequired,
  tags: PropTypes.array.isRequired,
  verseText: PropTypes.string.isRequired,
  verseChanged: PropTypes.bool.isRequired,
  comment: PropTypes.string.isRequired,
  contextIdReducer: PropTypes.shape({
    contextId: PropTypes.object
  }).isRequired,
  selectionsReducer: PropTypes.shape({
    selections: PropTypes.array<commit_msg>added gl quote to props for render<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
// components
import DefaultArea from './DefaultArea';
import SelectionArea from './SelectionArea';
import InstructionsArea from './InstructionsArea';
import EditVerseArea from './EditVerseArea';
import CommentArea from './CommentArea';
import style from '../css/Style';
class CheckArea extends Component {
  render() {
    const {
      actions,
      mode,
      tags,
      verseText,
      verseChanged,
      comment,
      glQuote,
      selectionsReducer,
      projectDetailsReducer
    } = this.props;
    let modeArea;
    switch (mode) {
      case 'edit':
        modeArea = (
          <EditVerseArea
            tags={tags}
            verseText={verseText}
            verseChanged={verseChanged}
            actions={actions}
            dir={projectDetailsReducer.manifest.target_language.direction}
          />
        );
        break;
      case 'comment':
        modeArea = <CommentArea comment={comment} actions={actions} />;
        break;
      case 'select':
        modeArea = (
          <div style={{ WebkitUserSelect: 'none', display: "flex", flex: "1", justifyContent: "center", alignItems: "center", overflow: "auto" }}>
            <InstructionsArea
              verseText={verseText}
              selectionsReducer={selectionsReducer}
              quote={glQuote}
              mode={mode}
            />
          </div>);
        break;
      case 'default':
      default:
        modeArea = (
          <div style={{ WebkitUserSelect: 'none', display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }}>
            <InstructionsArea dontShowTranslation={true} verseText={verseText} selectionsReducer={selectionsReducer} quote={glQuote} />
          </div>
        );
    }

    return (
      <div style={style.checkArea}>
        {mode === 'select' ?
          <SelectionArea
            {...this.props}
            actions={actions}
            quote={glQuote}
          /> :
          <DefaultArea {...this.props} />}
        <div style={{ borderLeft: '1px solid var(--border-color)', flex: 1, overflowY: "auto", display:'flex', justifyContent:'center' }}>
          {modeArea}
        </div>
      </div>
    );
  }
}

CheckArea.propTypes = {
  actions: PropTypes.object.isRequired,
  mode: PropTypes.string.isRequired,
  tags: PropTypes.array.isRequired,
  verseText: PropTypes.string.isRequired,
  verseChanged: PropTypes.bool.isRequired,
  comment: PropTypes.string.isRequired,
  glQuote: PropTypes.string.isRequired,
  contextIdReducer: PropTypes.shape({
    contextId: PropTypes.object
  }).isRequired,
  selectionsReducer: PropTypes.shape({
    selections: PropTypes.array
{'fraction_non_alphanumeric': 0.1260096930533118, 'fraction_numerical': 0.002154011847065159, 'mean_word_length': 2.4331484904497844, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '1753475', 'n_tokens_mistral': 1545, 'n_tokens_neox': 1532, 'n_words': 337}