filters fix for search/category page

This commit is contained in:
2025-05-27 15:22:46 +03:00
parent 85349bf961
commit 970b6408fb

View File

@@ -1,10 +1,9 @@
import React, { Suspense } from 'react' import React, { Suspense } from 'react'
import type { Metadata } from 'next' import type { Metadata } from 'next'
import SearchCard from '../components/SearchCard' import { SearchPageProps } from '@/app/types'
import { SearchCardProps, SearchPageProps } from '@/app/types'
import { fetchRoutes } from '@/lib/search/fetchRoutes' import { fetchRoutes } from '@/lib/search/fetchRoutes'
import SearchFilters from '../components/SearchFilters'
import AddressSelector from '@/components/AddressSelector' import AddressSelector from '@/components/AddressSelector'
import ClientResults from '../components/ClientResults'
export async function generateMetadata(): Promise<Metadata> { export async function generateMetadata(): Promise<Metadata> {
return { return {
@@ -62,15 +61,9 @@ export default async function SearchPage(props: SearchPageProps) {
: 'Поиск посылки - все предложения'} : 'Поиск посылки - все предложения'}
</h1> </h1>
<AddressSelector is_search={true} /> <AddressSelector is_search={true} />
<SearchFilters />
<Suspense fallback={<div>Загрузка результатов...</div>}> <Suspense fallback={<div>Загрузка результатов...</div>}>
<div className="space-y-4"> <ClientResults initialResults={results} />
{results.length > 0 ? (
results.map((item: SearchCardProps) => <SearchCard key={item.id} {...item} />)
) : (
<div className="text-center text-gray-500">Объявления не найдены</div>
)}
</div>
</Suspense> </Suspense>
</div> </div>
) )