<commit_before>// @flow

import React, { Component } from 'react';
import Search from '../components/Search';

class SearchContainer extends Component {
  state = {
    searchTerm: ''
  };
  props: {
    shows: Array<Show>
  };

  handleSearchTermChange = (event: SyntheticKeyboardEvent & { target: HTMLInputElement }) => {
    this.setState({ searchTerm: event.target.value });
  };

  render() {
    return (
      <Search
        searchTerm={this.state.searchTerm}
        handleSearchTermChange={this.handleSearchTermChange}
        shows={this.props.shows}
      />
    );
  }
}

export default SearchContainer;<commit_msg>Refactoring SearchContainer as High Order Component<commit_after>// @flow

import React, { Component } from 'react';

const SearchContainer = (SearchComponent: Component) =>
  class extends Component {
    state = {
      searchTerm: ''
    };

    handleSearchTermChange = (event: SyntheticKeyboardEvent & { target: HTMLInputElement }) => {
      this.setState({ searchTerm: event.target.value });
    };

    render() {
      return (
        <SearchComponent
          searchTerm={this.state.searchTerm}
          handleSearchTermChange={this.handleSearchTermChange}
          {...this.props}
        />
      );
    }
  };

export default SearchContainer;
{'fraction_non_alphanumeric': 0.12276612276612277, 'fraction_numerical': 0.0, 'mean_word_length': 2.926829268292683, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 9, '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': '7537807', 'n_tokens_mistral': 360, 'n_tokens_neox': 358, 'n_words': 74}