33import { Button } from "@/components/button" ;
44import { useCheckout } from "@moneydevkit/nextjs" ;
55import Link from "next/link" ;
6- import { useMemo , useState } from "react" ;
6+ import { Suspense , useMemo , useState } from "react" ;
7+ import { useSearchParams } from "next/navigation" ;
78
89const sellingPoints = [
910 "Creates a checkout session from the client and routes to /checkout/[id]" ,
@@ -14,11 +15,21 @@ const sellingPoints = [
1415
1516const chips = [
1617 { label : "App Router" , value : "Next.js 16" } ,
17- { label : "Payments" , value : "Lightning + USD " } ,
18+ { label : "Payments" , value : "Lightning + SAT " } ,
1819 { label : "Deploy target" , value : "Vercel" } ,
1920] ;
2021
2122export default function HomePage ( ) {
23+ return (
24+ < Suspense >
25+ < HomePageInner />
26+ </ Suspense >
27+ ) ;
28+ }
29+
30+ function HomePageInner ( ) {
31+ const searchParams = useSearchParams ( ) ;
32+ const amountFromUrl = Number ( searchParams . get ( "amount" ) ) || 20_000 ;
2233 const [ customerName , setCustomerName ] = useState ( "Satoshi Nakamoto" ) ;
2334 const [ note , setNote ] = useState ( "Fast IBD snapshot with hosted checkout." ) ;
2435 const [ error , setError ] = useState < string | null > ( null ) ;
@@ -40,8 +51,8 @@ export default function HomePage() {
4051 type : "AMOUNT" ,
4152 title : "Lightning download" ,
4253 description : "A quick Money Dev Kit checkout running on Vercel." ,
43- amount : 2500 ,
44- currency : "USD " ,
54+ amount : amountFromUrl ,
55+ currency : "SAT " ,
4556 successUrl : "/checkout/success" ,
4657 metadata,
4758 checkoutPath : "/checkout" ,
0 commit comments