route page search filters
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import React, { Suspense } from 'react'
|
||||
import React from 'react'
|
||||
import type { Metadata } from 'next'
|
||||
import SearchCard from '../../components/SearchCard'
|
||||
import { SearchCardProps, RouteSearchPageProps } from '@/app/types'
|
||||
import SearchFilters from '../../components/SearchFilters'
|
||||
import ClientResults from '../../components/ClientResults'
|
||||
|
||||
async function fetchSearch(category: string, from: string, to: string) {
|
||||
const response = await fetch(
|
||||
@@ -76,17 +77,7 @@ export default async function SearchPage(props: RouteSearchPageProps) {
|
||||
: 'Результаты не найдены'}
|
||||
</h1>
|
||||
|
||||
<SearchFilters />
|
||||
|
||||
<Suspense fallback={<div>Загрузка результатов...</div>}>
|
||||
<div className="space-y-4">
|
||||
{results.length > 0 ? (
|
||||
results.map((item: SearchCardProps) => <SearchCard key={item.id} {...item} />)
|
||||
) : (
|
||||
<div className="text-center text-gray-500">По данному маршруту ничего не найдено</div>
|
||||
)}
|
||||
</div>
|
||||
</Suspense>
|
||||
<ClientResults initialResults={results} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user