import YMMFilters, { YMMFiltersPlaceholder } from 'components/filters';
import Grid from 'components/grid';
import ProductsList from 'components/layout/products-list';
import { searchProducts } from 'components/layout/products-list/actions';
import SortingMenu from 'components/layout/search/sorting-menu';
import { Suspense } from 'react';
export const runtime = 'edge';
export const metadata = {
title: 'Search',
description: 'Search for products in the store.'
};
export default async function SearchPage({
searchParams
}: {
searchParams?: { [key: string]: string | string[] | undefined };
}) {
const { q: searchValue } = searchParams as { [key: string]: string };
const { products, pageInfo } = await searchProducts({ searchParams });
const resultsText = products.length > 1 ? 'results' : 'result';
return (
<>
{products.length === 0 ? 'There are no products that match ' : `Showing ${resultsText} for `} "{searchValue}"
) : null} {products.length > 0 ? (