тут нихуя не работает, ебаный рот этого казино
This commit is contained in:
25
frontend/style/app/search/page.tsx
Normal file
25
frontend/style/app/search/page.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ProductGrid } from "@/components/product-grid"
|
||||
import { SAMPLE_PRODUCTS } from "@/lib/sample-products"
|
||||
|
||||
export default function SearchPage({
|
||||
searchParams
|
||||
}: {
|
||||
searchParams: { q: string }
|
||||
}) {
|
||||
const searchTerm = searchParams.q || ''
|
||||
const filteredProducts = SAMPLE_PRODUCTS.filter(product =>
|
||||
product.title.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
<h1 className="text-2xl font-bold mb-6">Результаты поиска для "{searchTerm}"</h1>
|
||||
{filteredProducts.length > 0 ? (
|
||||
<ProductGrid products={filteredProducts} />
|
||||
) : (
|
||||
<p className="text-center text-gray-500">По вашему запросу ничего не найдено</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user