// @flow import React from 'react'; import LbcSymbol from 'component/common/lbc-symbol'; import WunderbarSuggestion from 'component/wunderbarSuggestion'; type Props = { winningUri: ?string, doResolveUris: (Array) => void, uris: Array, resolvingUris: boolean, preferEmbed: boolean, }; export default function WunderbarTopSuggestion(props: Props) { const { uris, resolvingUris, winningUri, doResolveUris, preferEmbed } = 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 || preferEmbed) { return null; } return ( <>

); }