/** * External dependencies */ import { useQuery } from '@woocommerce/navigation'; /** * Internal dependencies */ import './search-results.scss'; import { Product, ProductType, SearchResultType } from '../product-list/types'; import Products from '../products/products'; export interface SearchResultProps { products: Product[]; type: SearchResultType; } export default function SearchResults( props: SearchResultProps ): JSX.Element { const extensions = props.products.filter( ( product ) => product.type === ProductType.extension ); const themes = props.products.filter( ( product ) => product.type === ProductType.theme ); const query = useQuery(); const showCategorySelector = query.section ? true : false; return (
{ query?.section !== SearchResultType.theme && ( ) } { query?.section !== SearchResultType.extension && ( ) }
); }