@@ -12,13 +12,11 @@ import { Card } from '../ui/cards/Card';
12
12
import { SendAssetsData } from '../ui/modals/SendAssetsModal' ;
13
13
14
14
export function SendAssetsAction ( {
15
- index,
16
15
action,
17
16
onRemove,
18
17
} : {
19
- index : number ;
20
18
action : SendAssetsData ;
21
- onRemove : ( index : number ) => void ;
19
+ onRemove : ( ) => void ;
22
20
} ) {
23
21
const { t } = useTranslation ( 'common' ) ;
24
22
const { displayName } = useGetAccountName ( action . destinationAddress ) ;
@@ -47,9 +45,7 @@ export function SendAssetsAction({
47
45
color = "red-0"
48
46
variant = "tertiary"
49
47
size = "sm"
50
- onClick = { ( ) => {
51
- onRemove ( index ) ;
52
- } }
48
+ onClick = { onRemove }
53
49
>
54
50
< Icon as = { Trash } />
55
51
</ Button >
@@ -59,16 +55,14 @@ export function SendAssetsAction({
59
55
}
60
56
61
57
export function AirdropAction ( {
62
- index,
63
58
totalAmount,
64
59
recipientsCount,
65
60
onRemove,
66
61
asset,
67
62
} : {
68
- index : number ;
69
63
totalAmount : bigint ;
70
64
recipientsCount : number ;
71
- onRemove : ( index : number ) => void ;
65
+ onRemove : ( ) => void ;
72
66
asset : TokenBalance ;
73
67
} ) {
74
68
const { t } = useTranslation ( 'common' ) ;
@@ -98,9 +92,7 @@ export function AirdropAction({
98
92
color = "red-0"
99
93
variant = "tertiary"
100
94
size = "sm"
101
- onClick = { ( ) => {
102
- onRemove ( index ) ;
103
- } }
95
+ onClick = { onRemove }
104
96
>
105
97
< Icon as = { Trash } />
106
98
</ Button >
@@ -143,14 +135,13 @@ export function ProposalActionCard({
143
135
return (
144
136
< SendAssetsAction
145
137
key = { index }
146
- index = { index }
147
138
action = { {
148
139
destinationAddress,
149
140
transferAmount,
150
141
asset : actionAsset ,
151
142
nonceInput : undefined ,
152
143
} }
153
- onRemove = { removeAction }
144
+ onRemove = { ( ) => removeAction ( index ) }
154
145
/>
155
146
) ;
156
147
} else if ( action . actionType === ProposalActionType . AIRDROP ) {
@@ -174,11 +165,10 @@ export function ProposalActionCard({
174
165
return (
175
166
< AirdropAction
176
167
key = { index }
177
- index = { index }
178
168
asset = { actionAsset }
179
169
totalAmount = { totalAmount }
180
170
recipientsCount = { recipientsCount }
181
- onRemove = { removeAction }
171
+ onRemove = { ( ) => removeAction ( index ) }
182
172
/>
183
173
) ;
184
174
}
0 commit comments