<commit_before>import * as React from "react";

import {
	SearchkitComponent,
	SearchkitComponentProps,
	FastClick,
	NoFiltersHitCountAccessor,
	SuggestionsAccessor,
	ReactComponentType,
  renderComponent
} from "../../../../core"

import {NoHitsErrorDisplay, NoHitsErrorDisplayProps} from "./NoHitsErrorDisplay"
import {NoHitsDisplay, NoHitsDisplayProps} from "./NoHitsDisplay"

import {defaults} from "lodash"

export interface NoHitsProps extends SearchkitComponentProps {
	suggestionsField?:string
	errorComponent?: ReactComponentType<NoHitsErrorDisplayProps>
	component?: ReactComponentType<NoHitsDisplayProps>
}

export class NoHits extends SearchkitComponent<NoHitsProps, any> {
	noFiltersAccessor:NoFiltersHitCountAccessor
	suggestionsAccessor:SuggestionsAccessor
  bemBlocks: {
    container: Function
  }

	static translations = {
		"NoHits.NoResultsFound":"No results found for {query}.",
		"NoHits.NoResultsFoundDidYouMean":"No results found for {query}. Did you mean {suggestion}?",
		"NoHits.DidYouMean":"Search for {suggestion} instead",
		"NoHits.SearchWithoutFilters":"Search for {query} without filters",
		"NoHits.Error":"We're sorry, an issue occured when fetching your results. Please try again.",
		"NoHits.ResetSearch":"Reset Search"
	}
	translations = NoHits.translations

	static propTypes = defaults({
		suggestionsField:React.PropTypes.string,
		translations:SearchkitComponent.translationsPropType(
			NoHits.translations
		)
	}, SearchkitComponent.propTypes)

	static defaultProps = {
		errorComponent: NoHitsErrorDisplay,
		component: NoHitsDisplay
	}

	componentWillMount(){
		super.componentWillMount()
		this.noFiltersAccessor = this.searchkit.addAccessor(
			new NoFiltersHitCountAccessor()
		)
		if(this.props.suggestionsField){
			this.suggestionsAccessor = this.searchkit.addAccessor(<commit_msg>Fix misspelling in error message (#362)<commit_after>import * as React from "react";

import {
	SearchkitComponent,
	SearchkitComponentProps,
	FastClick,
	NoFiltersHitCountAccessor,
	SuggestionsAccessor,
	ReactComponentType,
  renderComponent
} from "../../../../core"

import {NoHitsErrorDisplay, NoHitsErrorDisplayProps} from "./NoHitsErrorDisplay"
import {NoHitsDisplay, NoHitsDisplayProps} from "./NoHitsDisplay"

import {defaults} from "lodash"

export interface NoHitsProps extends SearchkitComponentProps {
	suggestionsField?:string
	errorComponent?: ReactComponentType<NoHitsErrorDisplayProps>
	component?: ReactComponentType<NoHitsDisplayProps>
}

export class NoHits extends SearchkitComponent<NoHitsProps, any> {
	noFiltersAccessor:NoFiltersHitCountAccessor
	suggestionsAccessor:SuggestionsAccessor
  bemBlocks: {
    container: Function
  }

	static translations = {
		"NoHits.NoResultsFound":"No results found for {query}.",
		"NoHits.NoResultsFoundDidYouMean":"No results found for {query}. Did you mean {suggestion}?",
		"NoHits.DidYouMean":"Search for {suggestion} instead",
		"NoHits.SearchWithoutFilters":"Search for {query} without filters",
		"NoHits.Error":"We're sorry, an issue occurred when fetching your results. Please try again.",
		"NoHits.ResetSearch":"Reset Search"
	}
	translations = NoHits.translations

	static propTypes = defaults({
		suggestionsField:React.PropTypes.string,
		translations:SearchkitComponent.translationsPropType(
			NoHits.translations
		)
	}, SearchkitComponent.propTypes)

	static defaultProps = {
		errorComponent: NoHitsErrorDisplay,
		component: NoHitsDisplay
	}

	componentWillMount(){
		super.componentWillMount()
		this.noFiltersAccessor = this.searchkit.addAccessor(
			new NoFiltersHitCountAccessor()
		)
		if(this.props.suggestionsField){
			this.suggestionsAccessor = this.searchkit.addAccessor(
{'fraction_non_alphanumeric': 0.09721093961548877, 'fraction_numerical': 0.0008123476848090983, 'mean_word_length': 6.271653543307087, 'pattern_counts': {'":': 12, '<': 9, '<?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': '1678051', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1094, 'n_words': 230}