import React from 'react'
import { sparqlConnect } from '../sparql/configure-sparql'
import { LOADING, LOADED, FAILED } from 'sparql-connect'
import { Link } from 'react-router'
import { uriToLink } from '../router-mapping'
import { connect } from 'react-redux'
import { changeKeyword } from '../actions/app-state'

function SearchInput({ keyword, changeKeyword }) {
  return (
    <span>
      Search everything :
      <input type="search" placeholder="Enter a keyword"
             name="search_input"
             value={keyword}
             onChange={e => changeKeyword(e.target.value)} />
      <Link to={uriToLink.searchItems(keyword)}>Search</Link>
    </span>
  )
}

const mapStateToProps = state => ({ keyword: state.appState.keyword })
export default connect(mapStateToProps, { changeKeyword })(SearchInput)

@@ -144,20 +144,30 @@
 mport %7B 
-Link
+browserHistory
  %7D from 
@@ -610,17 +610,59 @@
    %3C
-Link to=%7B
+button %0A        onClick=%7B() =%3E browserHistory.push(
 uriT
@@ -691,22 +691,37 @@
 ord)
+)
 %7D%3E
-Search%3C/Link
+%0A        OK%0A      %3C/button
 %3E%0A  

Use button instead of link to navigate to search results