type params as promise

This commit is contained in:
2025-05-23 14:57:51 +03:00
parent fa70a96c27
commit 78c2ff356c
2 changed files with 4 additions and 10 deletions

View File

@@ -50,14 +50,12 @@ export async function generateMetadata(): Promise<Metadata> {
export default async function SearchPage(props: SearchPageProps) {
const params = await props.params
const { category } = params
const { results, count } = await fetchRoutes(category)
const { results, count } = await fetchRoutes(params.category || '')
return (
<div className="container mx-auto p-4">
<h1 className="mb-4 text-2xl font-bold">
{category === 'mover' ? 'Поиск перевозчика' : 'Поиск посылки'}
{params.category === 'mover' ? 'Поиск перевозчика' : 'Поиск посылки'}
</h1>
<Suspense fallback={<div>Загрузка результатов...</div>}>

View File

@@ -233,10 +233,6 @@ export interface SearchResponse {
}
export interface SearchPageProps {
params: {
category: string
}
searchParams: {
[key: string]: string | string[] | undefined
}
params: Promise<{ category?: string }>
searchParams?: Promise<{ [key: string]: string | string[] | undefined }>
}