This commit is contained in:
25
apps/web/src/app/catalog/CatalogContent.tsx
Normal file
25
apps/web/src/app/catalog/CatalogContent.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { filterProducts, parseSearchParams } from '@/lib/filterProducts';
|
||||
import { CatalogView } from '@/components/CatalogView/CatalogView';
|
||||
import { getProducts } from '@/lib/api';
|
||||
|
||||
export async function CatalogContent({
|
||||
params,
|
||||
}: {
|
||||
params: Record<string, string | string[] | undefined>;
|
||||
}) {
|
||||
const products = await getProducts();
|
||||
const filters = parseSearchParams(params);
|
||||
const filtered = filterProducts(products, filters);
|
||||
|
||||
const breadcrumbItems = [
|
||||
{ label: 'Главная', href: '/' },
|
||||
{ label: 'Каталог' },
|
||||
];
|
||||
|
||||
return (
|
||||
<CatalogView
|
||||
products={filtered}
|
||||
breadcrumbItems={breadcrumbItems}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user