<commit_before>import React from 'react'
import getPlayer from '../api/getPlayer'

import NBA from 'nba'

module.exports = ({state, dispatch}) => {
  const customClass = state.form.suggestions.length > 0 ? "suggestions" : "hidden"
    if (state.form.name && state.form.suggestions === 0) {
      return noSuggestions()
    }
    else {
      return (
        <div className={customClass}>
          {state.form.suggestions
            .filter((suggestion, index) => index < 14)
            .map((thisSuggestion, index) => {
              function handleClickSuggestion () {
                getPlayer(thisSuggestion.fullName, dispatch)
              }
              return (
                <div className="suggestion formElement button clickable" key={index} onClick={handleClickSuggestion}>
                  <p>{thisSuggestion.fullName}</p>
                </div>
              )
            })}
          </div>
        )
    }
}

function noSuggestions () {
  return (
    <p>No suggestions. Try refining your search</p>
  )
}
<commit_msg>Change the rendering of suggestions so that a more helpful 'refine results' bit is shown when there are no suggestions<commit_after>import React from 'react'
import getPlayer from '../api/getPlayer'

import NBA from 'nba'

module.exports = ({state, dispatch}) => {
  const suggestionLimit = 14
  const shouldShow = state.form.suggestions.length > 0 ? "suggestions" : "hidden"
    if (state.form.name === null) {
      return null
    }
    else {
      return (
        <div className="suggestions">
          {state.form.suggestions.length > 0 ?
            state.form.suggestions
            .filter((suggestion, index) => index < suggestionLimit)
            .map((thisSuggestion, index) => {
              function handleClickSuggestion () {
                getPlayer(thisSuggestion.fullName, dispatch)
              }
              return (
                <div className="suggestion formElement button clickable" key={index} onClick={handleClickSuggestion}>
                  <p>{thisSuggestion.fullName}</p>
                </div>
              )
            })
            :
            noSuggestions()
          }
          </div>
        )
    }
}

function noSuggestions () {
  return (
    <p>No suggestions. Try refining your search</p>
  )
}

{'fraction_non_alphanumeric': 0.1143975641583297, 'fraction_numerical': 0.0034797738147020443, 'mean_word_length': 1.9487179487179487, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 28, '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': '2454840', 'n_tokens_mistral': 656, 'n_tokens_neox': 611, 'n_words': 148}