feat: optymalizacja GlobalSearch, nawigacji oraz filtrów w sklepie
This commit is contained in:
+15
-2
@@ -9,7 +9,15 @@ export const metadata: Metadata = {
|
||||
alternates: { canonical: '/sklep' },
|
||||
};
|
||||
|
||||
export default function ShopPage() {
|
||||
interface Props {
|
||||
searchParams: Promise<{ search?: string; brand?: string }>;
|
||||
}
|
||||
|
||||
export default async function ShopPage({ searchParams }: Props) {
|
||||
const params = await searchParams;
|
||||
const initialSearch = params.search || '';
|
||||
const initialBrand = params.brand || '';
|
||||
|
||||
const products = getProducts();
|
||||
const brands = getBrands();
|
||||
const splitCount = products.filter(p => p.category === 'scienne').length;
|
||||
@@ -27,7 +35,12 @@ export default function ShopPage() {
|
||||
secondaryCtaLink={undefined}
|
||||
backgroundImage="https://images.unsplash.com/photo-1621905251189-08b45d6a269e?w=1600&q=80"
|
||||
/>
|
||||
<ProductsGrid products={products} brands={brands} />
|
||||
<ProductsGrid
|
||||
products={products}
|
||||
brands={brands}
|
||||
initialSearch={initialSearch}
|
||||
initialBrand={initialBrand}
|
||||
/>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user