import page from '@automattic/calypso-router'; import { SearchControl } from '@wordpress/components'; import { useViewportMatch } from '@wordpress/compose'; import clsx from 'clsx'; import { useTranslate } from 'i18n-calypso'; import { useDispatch, useSelector } from 'react-redux'; import { setQueryArgs } from 'calypso/lib/query-args'; import scrollTo from 'calypso/lib/scroll-to'; import { useLocalizedPlugins } from 'calypso/my-sites/plugins/utils'; import { recordGoogleEvent } from 'calypso/state/analytics/actions'; import { getSelectedSite } from 'calypso/state/ui/selectors'; import { useTermsSuggestions } from '../use-terms-suggestions'; import './style.scss'; const SearchBoxHeader = ( props ) => { const { searchTerm, title, subtitle, isSticky, stickySearchBoxRef, categoriesRef, renderTitleInH1, searchTerms, } = props; const isDesktop = useViewportMatch( 'large' ); const translate = useTranslate(); const dispatch = useDispatch(); const selectedSite = useSelector( getSelectedSite ); const { localizePath } = useLocalizedPlugins(); const recordSearchEvent = ( eventName ) => { dispatch( recordGoogleEvent( 'PluginsBrowser', eventName ) ); }; const classNames = [ 'search-box-header' ]; if ( isSticky ) { classNames.push( 'fixed-top' ); } return (
{ subtitle }
}