// @flow import ChannelMentionSuggestion from 'component/channelMentionSuggestion'; import LbcSymbol from 'component/common/lbc-symbol'; import React from 'react'; type Props = { uriFromQuery: string, winningUri: string, isResolvingUri: boolean, shownUris: Array, setMostSupported: (string) => void, doResolveUri: (string) => void, }; export default function ChannelMentionTopSuggestion(props: Props) { const { uriFromQuery, winningUri, isResolvingUri, shownUris, setMostSupported, doResolveUri } = props; React.useEffect(() => { if (uriFromQuery) doResolveUri(uriFromQuery); }, [doResolveUri, uriFromQuery]); React.useEffect(() => { if (winningUri) setMostSupported(winningUri); }, [setMostSupported, winningUri]); if (isResolvingUri) { return (

); } return !winningUri || shownUris.includes(winningUri) ? null : ( <>

); }