@@ -3,8 +3,10 @@ import { useMemo, useRef, useState } from 'react';
33import { SpotBuyInputType , SpotSellInputType , SpotSide } from '@/bonsai/forms/spot' ;
44
55import { ButtonAction , ButtonState } from '@/constants/buttons' ;
6+ import { STRING_KEYS } from '@/constants/localization' ;
67
78import { useSpotForm } from '@/hooks/useSpotForm' ;
9+ import { useStringGetter } from '@/hooks/useStringGetter' ;
810
911import { Button } from '@/components/Button' ;
1012
@@ -13,13 +15,10 @@ import { SpotFormInput } from './SpotFormInput';
1315import { SpotTabs , SpotTabVariant } from './SpotTabs' ;
1416
1517export const SpotTradeForm = ( ) => {
16- // Use the spot form hook for Redux-managed state
18+ const stringGetter = useStringGetter ( ) ;
1719 const form = useSpotForm ( ) ;
1820
19- // Local UI state (not in Redux)
2021 const [ isSubmitting , setIsSubmitting ] = useState ( false ) ;
21-
22- // Quick options state
2322 const [ quickOptionsState , setQuickOptionsState ] = useState ( {
2423 [ SpotSide . SELL ] : {
2524 [ SpotSellInputType . PERCENT ] : [ '10' , '25' , '50' , '100' ] ,
@@ -153,18 +152,20 @@ export const SpotTradeForm = () => {
153152 } }
154153 state = { isSubmitting ? ButtonState . Loading : ButtonState . Default }
155154 >
156- { form . state . side === SpotSide . BUY ? 'Buy' : 'Sell' }
155+ { form . state . side === SpotSide . BUY
156+ ? stringGetter ( { key : STRING_KEYS . BUY } )
157+ : stringGetter ( { key : STRING_KEYS . SELL } ) }
157158 </ Button >
158159 </ div >
159160 }
160161 items = { [
161162 {
162- label : 'Buy' ,
163+ label : stringGetter ( { key : STRING_KEYS . BUY } ) ,
163164 value : SpotSide . BUY ,
164165 variant : SpotTabVariant . Buy ,
165166 } ,
166167 {
167- label : 'Sell' ,
168+ label : stringGetter ( { key : STRING_KEYS . SELL } ) ,
168169 value : SpotSide . SELL ,
169170 variant : SpotTabVariant . Sell ,
170171 } ,
0 commit comments