11"use client"
22
3- import { useState , useEffect } from "react"
4- import { ChevronDown , Info , Zap } from "lucide-react"
3+ import { useState } from "react"
4+ import { ChevronDown } from "lucide-react"
55
66interface AmountCurrencySectionProps {
7- onPreview ?: ( ) => void
8- onSend ?: ( amount : number , currency : string ) => void
7+ onReview ?: ( amount : number , currency : string ) => void
8+ onBack ?: ( ) => void
99}
1010
11- export default function AmountCurrencySection ( { onPreview, onSend } : AmountCurrencySectionProps ) {
12- const [ mounted , setMounted ] = useState ( false )
13-
14- useEffect ( ( ) => {
15- setMounted ( true )
16- } , [ ] )
17-
11+ export default function AmountCurrencySection ( { onReview, onBack } : AmountCurrencySectionProps ) {
1812 const [ amount , setAmount ] = useState < string > ( "" )
1913 const [ currency , setCurrency ] = useState < string > ( "USDC" )
2014 const [ error , setError ] = useState < string > ( "" )
@@ -45,14 +39,9 @@ export default function AmountCurrencySection({ onPreview, onSend }: AmountCurre
4539 }
4640 }
4741
48- const handlePreview = ( ) => {
42+ const handleReview = ( ) => {
4943 if ( ! amount || error ) return
50- onPreview ?.( )
51- }
52-
53- const handleSend = ( ) => {
54- if ( ! amount || error ) return
55- onSend ?.( parseFloat ( amount ) , currency )
44+ onReview ?.( parseFloat ( amount ) , currency )
5645 }
5746
5847 const isValid =
@@ -73,7 +62,7 @@ export default function AmountCurrencySection({ onPreview, onSend }: AmountCurre
7362
7463 { /* Card Content */ }
7564 < div className = "relative z-10 bg-zinc-900/50 rounded-2xl p-6 border border-zinc-800 " >
76- < label className = "text-sm font-medium mb-3 block" >
65+ < label className = "text-sm font-medium mb-3 block text-white " >
7766 Amount (USD) < span className = "text-red-500" > *</ span >
7867 </ label >
7968 < div className = "relative" >
@@ -83,7 +72,7 @@ export default function AmountCurrencySection({ onPreview, onSend }: AmountCurre
8372 value = { amount }
8473 onChange = { handleAmountChange }
8574 onBlur = { handleAmountChange }
86- className = "w-full bg-zinc-800/50 border border-zinc-700 rounded-xl pl-8 pr-4 py-3.5 text-sm focus:outline-none focus:border-zinc-600 transition-colors"
75+ className = "w-full bg-zinc-800/50 border border-zinc-700 rounded-xl pl-8 pr-4 py-3.5 text-lg text-white focus:outline-none focus:border-red-500/50 transition-colors"
8776 placeholder = "0.00"
8877 />
8978 </ div >
@@ -99,20 +88,20 @@ export default function AmountCurrencySection({ onPreview, onSend }: AmountCurre
9988
10089 { /* Card Content */ }
10190 < div className = "relative z-10 bg-zinc-900/50 rounded-2xl p-6 border border-zinc-800" >
102- < label className = "text-sm font-medium mb-3 block" > Currency</ label >
91+ < label className = "text-sm font-medium mb-3 block text-white " > Currency</ label >
10392 < div className = "relative" >
10493 < select
10594 value = { currency }
10695 onChange = { ( e ) => setCurrency ( e . target . value ) }
107- className = "w-full bg-zinc-800/50 border border-zinc-700 rounded-xl px-4 py-3.5 text-sm focus:outline-none focus:border-zinc-600 transition-colors appearance-none text-zinc-400 "
96+ className = "w-full bg-zinc-800/50 border border-zinc-700 rounded-xl px-4 py-3.5 text-lg focus:outline-none focus:border-red-500/50 transition-colors appearance-none text-white "
10897 >
10998 { currencies . map ( ( c ) => (
11099 < option key = { c } value = { c } className = "bg-zinc-900 text-white" >
111100 { c }
112101 </ option >
113102 ) ) }
114103 </ select >
115- < ChevronDown className = "w-4 h-4 text-zinc-500 absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none" />
104+ < ChevronDown className = "w-5 h-5 text-zinc-500 absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none" />
116105 </ div >
117106 < p className = "text-xs text-zinc-500 mt-2" >
118107 { `1 ${ currency } = $${ ( conversionRates [ currency ] ?? 0 ) . toFixed ( 2 ) } USD` }
@@ -121,30 +110,21 @@ export default function AmountCurrencySection({ onPreview, onSend }: AmountCurre
121110 </ div >
122111 </ div >
123112
124- { /* Buttons */ }
125- < div className = "grid grid-cols-1 md:grid-cols-2 gap-6 mt-8" >
113+ { /* Primary CTA */ }
114+ < div className = "flex flex-col gap-4 mt-8" >
126115 < button
127- onClick = { handlePreview }
116+ onClick = { handleReview }
128117 disabled = { ! isValid }
129- className = { `w-full py-3.5 bg-zinc-900 hover:bg-zinc-800 rounded-xl text-sm font-medium transition-colors border border-zinc-800 flex items-center justify-center gap-2 ${
130- isValid ? "opacity-100" : "opacity-60 cursor-not-allowed"
131- } `}
132- aria-disabled = { ! isValid }
118+ className = { `w-full py-4 bg-red-600 hover:bg-red-700 disabled:bg-zinc-800 disabled:text-zinc-500 disabled:cursor-not-allowed rounded-2xl text-lg font-bold transition-all transform active:scale-[0.98] shadow-lg shadow-red-900/20 flex items-center justify-center gap-2` }
133119 >
134- < Info className = "w-4 h-4" />
135- Preview Transaction
120+ Review Transaction
136121 </ button >
137-
122+
138123 < button
139- onClick = { handleSend }
140- disabled = { ! isValid }
141- className = { `w-full py-3.5 bg-red-600 hover:bg-red-700 rounded-xl text-sm font-medium transition-colors flex items-center justify-center gap-2 ${
142- isValid ? "opacity-100" : "opacity-60 cursor-not-allowed"
143- } `}
144- aria-disabled = { ! isValid }
124+ onClick = { onBack }
125+ className = "w-full py-4 bg-transparent hover:bg-white/5 rounded-2xl text-sm font-medium text-zinc-400 transition-colors border border-zinc-800/50"
145126 >
146- < Zap className = "w-4 h-4" />
147- Send Remittance
127+ Back to Recipient
148128 </ button >
149129 </ div >
150130 </ div >
0 commit comments