<commit_before>import React from 'react'
import { connect } from 'react-redux'

import { Response } from '../api'
import { setActive } from './actions/Overlay'
import { BodyInput, CaptureCompletion } from './BodyInput'
import { BoostRules } from './Boosts'
import { Results } from './Results'
import Tabs from './Tabs'


const close = ({ closeOverlay }) => (
  <div id='sj-overlay-close' onClick={closeOverlay}>
    <div className='sj-close'>&times;</div>
    <div className='sj-esc'>ESC</div>
  </div>
)

const Close = connect(
  null,
  dispatch => ({ closeOverlay: () => dispatch(setActive(false)) })
)(close)

const logo = ({ closeOverlay, src, alt, className }) => (
  <div id='sj-overlay-logo'>
    <img id='sj-overlay-logo-image' onClick={closeOverlay} src={src} alt={alt} className={className} />
  </div>
)

const Logo = connect(
  null,
  dispatch => ({ closeOverlay: () => dispatch(setActive(false)) })
)(logo)

const overlay = ({ active, children }) => {
  if (!active) {
    return null
  }

  return (
    <div id='sj-overlay'>
      <div id='sj-overlay-search-modal'>
        {children}
      </div>
    </div>
  )
}

const Overlay = connect(
  ({ overlay }) => ({ active: overlay.active })
)(overlay)

const DefaultOverlay = ({ tabs, tabsOnChange, defaultTab, logoUrl }) => (<commit_msg>Wrap body input and search when body has changed<commit_after>import React from 'react'
import { connect } from 'react-redux'

import { Response } from '../api'
import { setActive } from './actions/Overlay'
import { BodyInput, CaptureCompletion } from './BodyInput'
import { BoostRules } from './Boosts'
import { Results } from './Results'
import Tabs from './Tabs'
import { triggerSearch } from './actions/Search'

const close = ({ closeOverlay }) => (
  <div id='sj-overlay-close' onClick={closeOverlay}>
    <div className='sj-close'>&times;</div>
    <div className='sj-esc'>ESC</div>
  </div>
)

const Close = connect(
  null,
  dispatch => ({ closeOverlay: () => dispatch(setActive(false)) })
)(close)

const logo = ({ closeOverlay, src, alt, className }) => (
  <div id='sj-overlay-logo'>
    <img id='sj-overlay-logo-image' onClick={closeOverlay} src={src} alt={alt} className={className} />
  </div>
)

const Logo = connect(
  null,
  dispatch => ({ closeOverlay: () => dispatch(setActive(false)) })
)(logo)

const overlay = ({ active, children }) => {
  if (!active) {
    return null
  }

  return (
    <div id='sj-overlay'>
      <div id='sj-overlay-search-modal'>
        {children}
      </div>
    </div>
  )
}

const Overlay = connect(
  ({ overlay }) => ({ active: overlay.active })
)(overlay)

class wrappedBodyInput extends React.Component {
  componentDidUpdate() {
    this.props.triggerSearch()
  }

  render() {
    return (
      <BodyInput
        namespace='default'
        prefixBoosts={{
          'title': 0.03
        }}
        containsBoosts={{
          'title': 0.05
        }}
      />
    )
  }
}

const WrappedBodyInput = connect(
  ({ search }) => ({ body: search.body }),
  (dispatch) => ({ triggerSearch: () => dispatch(triggerSearch('default')) })
)(wrappedBodyInput)

const DefaultOverlay = ({ tabs, tabsOnChange, defaultTab, logoUrl }) => (
{'fraction_non_alphanumeric': 0.17785445420326224, 'fraction_numerical': 0.0018820577164366374, 'mean_word_length': 3.3986206896551723, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 51, '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': '5958515', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1025, 'n_words': 246}