// @flow import React from 'react'; import LbcSymbol from 'component/common/lbc-symbol'; import WunderbarSuggestion from 'component/wunderbarSuggestion'; import { ComboboxOption } from '@reach/combobox'; type Props = { query: string, winningUri: ?string, doResolveUris: (Array) => void, uris: Array, resolvingUris: boolean, }; export default function WunderbarTopSuggestion(props: Props) { const { query, uris, resolvingUris, winningUri, doResolveUris } = props; const stringifiedUris = JSON.stringify(uris); React.useEffect(() => { if (stringifiedUris) { const arrayUris = JSON.parse(stringifiedUris); if (arrayUris.length > 0) { doResolveUris(arrayUris); } } }, [doResolveUris, stringifiedUris]); if (resolvingUris) { return (

); } if (!winningUri) { return null; } return ( <>

); }