<commit_before>import React, { PureComponent } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'

import withUserMedia from '../hocs/withUserMedia'
import withSandbox from '../hocs/withSandbox'
import integrateLobby from '../hocs/integrateLobby'

import Video from '../components/Video'
import Editor from '../components/Editor'
import TestTable from '../components/TestTable'

class Lobby extends PureComponent {
  constructor(props) {
    super(props)
    this.state = {}
    this.onRunClick = this.onRunClick.bind(this)
  }

  renderLoading() {
    return (
      <span>Loading...</span>
    )
  }


  onChallengeClick() {
    // write function for if someone clicks on specific challenge

  }

  onEditorChange(newValue) {
    this.setState({ editorValue: newValue }, () => {
      this.state.connection &&
      this.state.connection.send({ editorValue: newValue })
    })
  }

  onRunClick(e) {
    this.props.sandboxEval(this.props.editorValue)
  }

  renderComplete() {
    const { stream: myStream, peerStream, sandboxResult, tests } = this.props
    return (
      <div className="lobby-page">
        <div className="left-screen">
          <section className="webcam-section">
            <div className="parent-webcam">
              <div className="myStream">
                {myStream && <Video streamId={myStream.id} src={URL.createObjectURL(myStream)} muted={true}/>}
              </div>
              <div className="video-responsive video-responsive-4-3 waiting">
                {peerStream ? <Video streamId={peerStream.id} src={URL.createObjectURL(peerStream)} muted={false}/> : <span>Waiting for Peer.</span>}
              </div>
            </div>
          </section>
          <TestTable
            tests={tests}
            sandboxResult={sandboxResult || []} />
        </div>
        <section className='editor-section' >
          <Editor
            value={this.props.editorValue}
            onChange={this.props.onEditorChange} />
          <button onClick={this.onRunClick}>Run</button><commit_msg>Fixed editor error<commit_after>import React, { PureComponent } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'

import withUserMedia from '../hocs/withUserMedia'
import withSandbox from '../hocs/withSandbox'
import integrateLobby from '../hocs/integrateLobby'

import Video from '../components/Video'
import Editor from '../components/Editor'
import TestTable from '../components/TestTable'

class Lobby extends PureComponent {
  constructor(props) {
    super(props)
    this.state = {}
    this.onRunClick = this.onRunClick.bind(this)
  }

  renderLoading() {
    return (
      <span>Loading...</span>
    )
  }


  onChallengeClick() {
    // write function for if someone clicks on specific challenge

  }

  onEditorChange(newValue) {
    this.setState({ editorValue: newValue }, () => {
      this.state.connection &&
      this.state.connection.send({ editorValue: newValue })
    })
  }

  onRunClick(e) {
    this.props.sandboxEval(this.props.editorValue)
  }

  renderComplete() {
    const { stream: myStream, peerStream, sandboxResult, tests } = this.props
    return (
      <div className="lobby-page">
        <div className="left-screen">
          <section className="webcam-section">
            <div className="parent-webcam">
              <div className="myStream">
                {myStream && <Video streamId={myStream.id} src={URL.createObjectURL(myStream)} muted={true}/>}
              </div>
              <div className="video-responsive video-responsive-4-3 waiting">
                {peerStream ? <Video streamId={peerStream.id} src={URL.createObjectURL(peerStream)} muted={false}/> : <span>Waiting for Peer.</span>}
              </div>
            </div>
          </section>
          <TestTable
            tests={tests}
            sandboxResult={sandboxResult || []} />
        </div>
        <section className='editor-section' >
          <Editor
            value={this.props.editorValue || ''}
            onChange={this.props.onEditorChange} />
          <button onClick={this.onRunClick}>Run</button>
{'fraction_non_alphanumeric': 0.1358054418492656, 'fraction_numerical': 0.000963159162051529, 'mean_word_length': 2.6216216216216215, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 49, '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': '4976122', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1173, 'n_words': 241}