search urls
This commit is contained in:
44
frontend/app/(urls)/search/[category]/page.tsx
Normal file
44
frontend/app/(urls)/search/[category]/page.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import React, { Suspense } from 'react'
|
||||
import SearchCard from '../components/SearchCard'
|
||||
|
||||
interface SearchPageProps {
|
||||
params: {
|
||||
category: string
|
||||
}
|
||||
searchParams: {
|
||||
[key: string]: string | string[] | undefined
|
||||
}
|
||||
}
|
||||
|
||||
// получаем все предложения по выбранному owner_type
|
||||
async function fetchSearch(category: string, query: string = '') {
|
||||
// get search api(owner_type)
|
||||
return []
|
||||
}
|
||||
|
||||
export default async function SearchPage(props: SearchPageProps) {
|
||||
const params = await props.params
|
||||
const { category } = params
|
||||
|
||||
const initialData = await fetchSearch(category)
|
||||
|
||||
return (
|
||||
<div className="container mx-auto p-4">
|
||||
<h1 className="mb-4 text-2xl font-bold">
|
||||
{category === 'mover' ? 'Поиск перевозчика' : 'Поиск посылки'}
|
||||
</h1>
|
||||
|
||||
<Suspense fallback={<div>Загрузка результатов...</div>}>
|
||||
{/* Здесь будет компонент с результатами поиска */}
|
||||
<div className="space-y-4">
|
||||
{initialData.map((item: any, index: number) => (
|
||||
<div key={index} className="rounded-lg border p-4">
|
||||
{/* Здесь будет карточка с результатом */}
|
||||
<p>Результат поиска {index + 1}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Suspense>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user