// @flow import TextareaSuggestionsItem from 'component/textareaSuggestionsItem'; import LbcSymbol from 'component/common/lbc-symbol'; import React from 'react'; type Props = { filteredTop: string, isResolvingUri: boolean, uriFromQuery: string, winningUri: string, doResolveUri: (string) => void, setTopSuggestion: (string) => void, }; export default function TextareaTopSuggestion(props: Props) { const { filteredTop, isResolvingUri, uriFromQuery, winningUri, doResolveUri, setTopSuggestion } = props; React.useEffect(() => { if (uriFromQuery) doResolveUri(uriFromQuery); }, [doResolveUri, uriFromQuery]); React.useEffect(() => { if (winningUri) setTopSuggestion(winningUri); }, [setTopSuggestion, winningUri]); if (isResolvingUri) { return (
); } return filteredTop && filteredTop.length > 0 ? (

) : null; }