@@ -7,11 +7,9 @@ import { Button } from '@/components/ui/button';
77import { Input } from '@/components/ui/input' ;
88import { Label } from '@/components/ui/label' ;
99import { Textarea } from '@/components/ui/textarea' ;
10- import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from '@/components/ui/select' ;
1110import { Card , CardContent , CardHeader , CardTitle } from '@/components/ui/card' ;
1211import { useBalance } from '@/hooks/safe/useBalance' ;
13-
14- type TransactionType = 'send_token' | 'custom' ;
12+ import type { TransactionType } from './TransactionTypeSelector' ;
1513
1614interface BuildFormData {
1715 recipient ?: string ;
@@ -157,8 +155,8 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
157155 } ;
158156
159157 const renderSendTokenForm = ( ) => (
160- < div className = 'space-y -4' >
161- < div >
158+ < div className = 'grid gap -4' >
159+ < div className = 'grid gap-2' >
162160 < Label htmlFor = 'recipient' > Recipient Address</ Label >
163161 < Input
164162 id = 'recipient'
@@ -167,10 +165,10 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
167165 onChange = { ( e ) => setFormData ( ( prev ) => ( { ...prev , recipient : e . target . value } ) ) }
168166 className = { errors . recipient ? 'border-destructive' : '' }
169167 />
170- { errors . recipient && < p className = 'text-sm text-destructive mt-1 ' > { errors . recipient } </ p > }
168+ { errors . recipient && < p className = 'text-sm text-destructive' > { errors . recipient } </ p > }
171169 </ div >
172170
173- < div >
171+ < div className = 'grid gap-2' >
174172 < Label htmlFor = 'tokenAddress' > Token (Optional - ETH if empty)</ Label >
175173 < Input
176174 id = 'tokenAddress'
@@ -179,10 +177,10 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
179177 onChange = { ( e ) => setFormData ( ( prev ) => ( { ...prev , tokenAddress : e . target . value } ) ) }
180178 className = { errors . tokenAddress ? 'border-destructive' : '' }
181179 />
182- { errors . tokenAddress && < p className = 'text-sm text-destructive mt-1 ' > { errors . tokenAddress } </ p > }
180+ { errors . tokenAddress && < p className = 'text-sm text-destructive' > { errors . tokenAddress } </ p > }
183181 </ div >
184182
185- < div >
183+ < div className = 'grid gap-2' >
186184 < Label htmlFor = 'amount' > Amount</ Label >
187185 < Input
188186 id = 'amount'
@@ -193,17 +191,17 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
193191 onChange = { ( e ) => setFormData ( ( prev ) => ( { ...prev , amount : e . target . value } ) ) }
194192 className = { errors . amount ? 'border-destructive' : '' }
195193 />
196- { errors . amount && < p className = 'text-sm text-destructive mt-1 ' > { errors . amount } </ p > }
194+ { errors . amount && < p className = 'text-sm text-destructive' > { errors . amount } </ p > }
197195 { balances . length > 0 && (
198- < p className = 'text-sm text-muted-foreground mt-1 ' > Available tokens: { balances . length } types</ p >
196+ < p className = 'text-sm text-muted-foreground' > Available tokens: { balances . length } types</ p >
199197 ) }
200198 </ div >
201199 </ div >
202200 ) ;
203201
204202 const renderCustomContractForm = ( ) => (
205- < div className = 'space-y -4' >
206- < div >
203+ < div className = 'grid gap -4' >
204+ < div className = 'grid gap-2' >
207205 < Label htmlFor = 'contractAddress' > Contract Address</ Label >
208206 < Input
209207 id = 'contractAddress'
@@ -212,10 +210,10 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
212210 onChange = { ( e ) => setFormData ( ( prev ) => ( { ...prev , contractAddress : e . target . value } ) ) }
213211 className = { errors . contractAddress ? 'border-destructive' : '' }
214212 />
215- { errors . contractAddress && < p className = 'text-sm text-destructive mt-1 ' > { errors . contractAddress } </ p > }
213+ { errors . contractAddress && < p className = 'text-sm text-destructive' > { errors . contractAddress } </ p > }
216214 </ div >
217215
218- < div >
216+ < div className = 'grid gap-2' >
219217 < Label htmlFor = 'abi' > ABI (JSON format)</ Label >
220218 < Textarea
221219 id = 'abi'
@@ -225,10 +223,10 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
225223 className = { errors . abi ? 'border-destructive' : '' }
226224 rows = { 4 }
227225 />
228- { errors . abi && < p className = 'text-sm text-destructive mt-1 ' > { errors . abi } </ p > }
226+ { errors . abi && < p className = 'text-sm text-destructive' > { errors . abi } </ p > }
229227 </ div >
230228
231- < div >
229+ < div className = 'grid gap-2' >
232230 < Label htmlFor = 'functionName' > Function Name</ Label >
233231 < Input
234232 id = 'functionName'
@@ -237,10 +235,10 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
237235 onChange = { ( e ) => setFormData ( ( prev ) => ( { ...prev , functionName : e . target . value } ) ) }
238236 className = { errors . functionName ? 'border-destructive' : '' }
239237 />
240- { errors . functionName && < p className = 'text-sm text-destructive mt-1 ' > { errors . functionName } </ p > }
238+ { errors . functionName && < p className = 'text-sm text-destructive' > { errors . functionName } </ p > }
241239 </ div >
242240
243- < div >
241+ < div className = 'grid gap-2' >
244242 < Label htmlFor = 'value' > Value (ETH to send, optional)</ Label >
245243 < Input
246244 id = 'value'
@@ -251,7 +249,7 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
251249 onChange = { ( e ) => setFormData ( ( prev ) => ( { ...prev , value : e . target . value } ) ) }
252250 className = { errors . value ? 'border-destructive' : '' }
253251 />
254- { errors . value && < p className = 'text-sm text-destructive mt-1 ' > { errors . value } </ p > }
252+ { errors . value && < p className = 'text-sm text-destructive' > { errors . value } </ p > }
255253 </ div >
256254 </ div >
257255 ) ;
@@ -261,7 +259,7 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
261259 < CardHeader >
262260 < CardTitle > { type === 'send_token' ? 'Send Token' : 'Custom Contract Transaction' } </ CardTitle >
263261 </ CardHeader >
264- < CardContent className = 'space-y -6' >
262+ < CardContent className = 'grid gap -6' >
265263 { type === 'send_token' ? renderSendTokenForm ( ) : renderCustomContractForm ( ) }
266264
267265 { errors . general && (
@@ -270,11 +268,11 @@ export function TransactionBuilder({ type, onComplete, onBack }: TransactionBuil
270268 </ div >
271269 ) }
272270
273- < div className = 'flex justify-between ' >
274- < Button variant = 'outline' onClick = { onBack } >
271+ < div className = 'flex flex-col sm:flex-row gap-3 ' >
272+ < Button variant = 'outline' onClick = { onBack } className = 'sm:flex-1' >
275273 Cancel
276274 </ Button >
277- < Button onClick = { handleSubmit } disabled = { isLoading } >
275+ < Button onClick = { handleSubmit } disabled = { isLoading } className = 'sm:flex-1' >
278276 { isLoading ? 'Building...' : 'Build Transaction' }
279277 </ Button >
280278 </ div >
0 commit comments