File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
app/(dashboard)/pricing/checkout Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1- import { Suspense } from "react" ;
1+ import { Suspense , use } from "react" ;
22import { processPayment } from "@/lib/payments/actions" ;
33
44function CheckoutForm ( {
55 searchParams,
66} : {
7- searchParams : { plan ?: string ; amount ?: string } ;
7+ searchParams : Promise < { plan ?: string ; amount ?: string } > ;
88} ) {
9- const planName = searchParams . plan || "Unknown Plan" ;
10- const amount = Number ( searchParams . amount ) || 0 ;
9+ const resolvedParams = use ( searchParams ) ;
10+ const planName = resolvedParams . plan || "Unknown Plan" ;
11+ const amount = Number ( resolvedParams . amount ) || 0 ;
1112
1213 return (
1314 < main className = "max-w-2xl mx-auto px-4 sm:px-6 lg:px-8 py-12" >
@@ -237,15 +238,14 @@ function CheckoutForm({
237238 ) ;
238239}
239240
240- export default async function CheckoutPage ( {
241+ export default function CheckoutPage ( {
241242 searchParams,
242243} : {
243244 searchParams : Promise < { plan ?: string ; amount ?: string } > ;
244245} ) {
245- const resolvedSearchParams = await searchParams ;
246246 return (
247247 < Suspense fallback = { < div > Loading...</ div > } >
248- < CheckoutForm searchParams = { resolvedSearchParams } />
248+ < CheckoutForm searchParams = { searchParams } />
249249 </ Suspense >
250250 ) ;
251251}
You can’t perform that action at this time.
0 commit comments