Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6632 stevensc 1
import React from 'react'
2
import { useForm } from 'react-hook-form'
3
 
4
const SearchInput = () => {
5
  const { handleSubmit, register } = useForm()
6
  const handleOnSubmit = (data) => window.location.replace(`/search/entity/user?keyword=${data.keyword}`)
7
 
8
  return (
9
        <div className='searchInputContainer'>
10
            <form onSubmit={handleSubmit(handleOnSubmit)}>
11
                <input
12
                    type="text"
13
                    id="keyword"
14
                    name="keyword"
15
                    placeholder="Buscar"
16
                    ref={register}
17
                />
18
                <button type="submit">
19
                    <i className="la la-search" />
20
                </button>
21
            </form>
22
        </div>
23
  )
24
}
25
 
26
export default SearchInput