Другой роутинг
Some checks failed
CI / main (push) Has been cancelled

This commit is contained in:
Igor Rybakov
2026-03-06 23:24:16 +02:00
parent 6228624805
commit f919ea66f6
19 changed files with 500 additions and 160 deletions

View File

@@ -0,0 +1,49 @@
import { Suspense } from 'react';
import { Product } from '@/types';
import { Breadcrumb } from '@/components/Breadcrumb/Breadcrumb';
import { CatalogSidebar } from '@/components/CatalogSidebar/CatalogSidebar';
import { ProductCard } from '@/components/ProductCard/ProductCard';
import styles from './CatalogView.module.scss';
interface BreadcrumbItem {
label: string;
href?: string;
}
interface CatalogViewProps {
products: Product[];
breadcrumbItems: BreadcrumbItem[];
basePath?: string;
hiddenFilters?: string[];
}
export function CatalogView({
products,
breadcrumbItems,
basePath = '/catalog',
hiddenFilters,
}: CatalogViewProps) {
return (
<div className={styles.layout}>
<Suspense fallback={null}>
<CatalogSidebar basePath={basePath} hiddenFilters={hiddenFilters} />
</Suspense>
<div className={styles.main}>
<div className={styles.header}>
<Breadcrumb items={breadcrumbItems} />
<span className={styles.count}>{products.length} позиций</span>
</div>
<div className={styles.grid}>
{products.map((p) => (
<ProductCard key={p.id} product={p} />
))}
</div>
{products.length === 0 && (
<p className={styles.empty}>
По выбранным фильтрам ничего не найдено.
</p>
)}
</div>
</div>
);
}