<commit_before>import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import Geosuggest from 'react-geosuggest';

import { createKetoLocation } from '../actions';

// import PlacesSearchBox from './places_searchbox';


class Shareketo extends Component {
  constructor(props) {
    super(props);
    this.state = {
      selectedSuggestion: ''
    };
    
    this.onSubmit = this.onSubmit.bind(this);
    this.onSuggestSelect = this.onSuggestSelect.bind(this);
    this.onSuggestNoResults = this.onSuggestNoResults.bind(this);
  }
  
  onSuggestSelect(suggest) {
    this.setState({selectedSuggestion:suggest});
  }
  
  onSuggestNoResults(suggest) {
    
    console.log(suggest);
  }
  
  onSubmit(ketoForm) {
    const ketoPost = { 
      ...ketoForm, 
      place:this.state.selectedSuggestion.label,
      location:this.state.selectedSuggestion.location,
      placeId: this.state.selectedSuggestion.placeId,
      address: this.state.selectedSuggestion.gmaps.formatted_address
    }
    console.log(this.state.selectedSuggestion)
    console.log(ketoPost);
    
    this.props.createKetoLocation(ketoPost, () => {
      this.props.history.push('/');
    })
  }
  
  renderField(field) {
    const { meta: { touched, error } } = field;
    const className= `form-group ${touched && error ? 'has-danger' : ''}`
    
    return (
      <div className={className}>
        <input
          placeholder={field.label}
          type="text"
          {...field.input}
        />
        <div className="text-help">
          {touched ? error : ''}
        </div>
      </div>
    )
  }
  
  renderRenderTextArea(field) {
    const { meta: { touched, error } } = field;
    const className= `form-group ${touched && error ? 'has-danger' : ''}`
    
    return (
      <div className={className}><commit_msg>removed unused function<commit_after>import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import Geosuggest from 'react-geosuggest';

import { createKetoLocation } from '../actions';

// import PlacesSearchBox from './places_searchbox';


class Shareketo extends Component {
  constructor(props) {
    super(props);
    this.state = {
      selectedSuggestion: ''
    };
    
    this.onSubmit = this.onSubmit.bind(this);
    this.onSuggestSelect = this.onSuggestSelect.bind(this);
    this.onSuggestNoResults = this.onSuggestNoResults.bind(this);
  }
  
  onSuggestSelect(suggest) {
    this.setState({selectedSuggestion:suggest});
  }
  
  onSuggestNoResults(suggest) {
    console.log(suggest);
  }
  
  onSubmit(ketoForm) {
    const ketoPost = { 
      ...ketoForm, 
      place:this.state.selectedSuggestion.label,
      location:this.state.selectedSuggestion.location,
      placeId: this.state.selectedSuggestion.placeId,
      address: this.state.selectedSuggestion.gmaps.formatted_address
    }
    console.log(this.state.selectedSuggestion)
    console.log(ketoPost);
    
    this.props.createKetoLocation(ketoPost, () => {
      this.props.history.push('/');
    })
  }
  
  renderField(field) {
    const { meta: { touched, error } } = field;
    const className= `form-group ${touched && error ? 'has-danger' : ''}`
    
    return (
      <div className={className}>
{'fraction_non_alphanumeric': 0.13459232613908872, 'fraction_numerical': 0.0, 'mean_word_length': 2.986857825567503, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, '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': '3922033', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1037, 'n_words': 172}