feat: optymalizacja GlobalSearch, nawigacji oraz filtrów w sklepie

This commit is contained in:
MichalC
2026-06-27 21:12:23 +02:00
parent 0c59086a6b
commit c4294a81cf
43 changed files with 1623 additions and 192 deletions
+15 -2
View File
@@ -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>
);
}