import { setEntreprise } from 'Actions/existingCompanyActions' import { React, T } from 'Components' import CompanyDetails from 'Components/CompanyDetails' import { useCallback, useMemo, useState } from 'react' import { useDispatch } from 'react-redux' // $FlowFixMe import 'react-select/dist/react-select.css' import { searchDenominationOrSiren } from '../api/sirene' import { debounce } from '../utils' export default function Search() { const [searchResults, setSearchResults] = useState() const [isLoading, setLoadingState] = useState(false) const handleSearch = useCallback( function(value) { searchDenominationOrSiren(value).then(results => { setLoadingState(false) setSearchResults(results) }) }, [setSearchResults, setLoadingState] ) const debouncedHandleSearch = useMemo(() => debounce(300, handleSearch), [ handleSearch ]) const dispatch = useDispatch() return ( <>

Retrouver mon entreprise

Grâce à la base SIREN, les données publiques sur votre entreprise seront automatiquement disponibles pour la suite du parcours sur le site.


{ if (e.target.value.length < 2) { setSearchResults(undefined) return } setLoadingState(true) debouncedHandleSearch(e.target.value) }} /> {!isLoading && searchResults === null &&

Aucun résultat

} {searchResults && searchResults.map(({ siren, denomination }) => ( ))} ) }