Files
tripwithbonus/frontend/app/(urls)/search/[category]/page.tsx
2025-05-23 13:44:49 +03:00

45 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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>
)
}