<commit_before>import React, {Component} from 'react'

const ManualRefresh = WrappedComponent =>
  class extends Component {
    constructor(props) {
      super(props)
      this.state = {
        manualRefresh: Date.now(),
      }
    }

    handleManualRefresh = () => {
      this.setState({
        manualRefresh: Date.now(),
      })
    }

    render() {
      return (
        <WrappedComponent
          {...this.props}
          manualRefresh={this.state.manualRefresh}
          onManualRefresh={this.handleManualRefresh}
        />
      )
    }
  }

export default ManualRefresh<commit_msg>Convert ManualRefresh to TypeScript<commit_after>import React, {Component, ComponentClass} from 'react'

export interface ManualRefreshProps {
  manualRefresh: number
  onManualRefresh: () => void
}

interface ManualRefreshState {
  manualRefresh: number
}

const ManualRefresh = <P extends ManualRefreshProps>(
  WrappedComponent: ComponentClass<P>
): ComponentClass<P> =>
  class extends Component<P, ManualRefreshState> {
    public constructor(props: P) {
      super(props)
      this.state = {
        manualRefresh: Date.now(),
      }
    }

    public render() {
      return (
        <WrappedComponent
          {...this.props}
          manualRefresh={this.state.manualRefresh}
          onManualRefresh={this.handleManualRefresh}
        />
      )
    }

    private handleManualRefresh = (): void => {
      this.setState({
        manualRefresh: Date.now(),
      })
    }
  }

export default ManualRefresh
{'fraction_non_alphanumeric': 0.10819672131147541, 'fraction_numerical': 0.0, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, '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': '4658384', 'n_tokens_mistral': 435, 'n_tokens_neox': 421, 'n_words': 83}