       method: 'POST'
       data: JSON.stringify
         queries: [query]
-        max_hits: @state.maxHits
+        max_hits: state.maxHits
       dataType: 'json'
       contentType: 'application/json'
     ).then (res) =>

    @setState(query: query)

  handleMaxHitsChanged: (maxHits) ->
    @setState(maxHits: maxHits)
    @handleSearch()

  showCorpusHome: ->
    alert 'showCorpusHome'

  handleSearch: ->
    {store, statechart, corpus} = @props
    searchEngine = corpus.search_engine ?= 'cwb'
    url = "search_engines/#{searchEngine}_searches"
    query =
      query: @state.query
      corpusShortName: corpus.short_name

    $.ajax(

#= require rglossa/react/utils
#= require ./main_area_top
#= require ./main_area_bottom

