@@ -58,6 +58,12 @@ type FirstRowReportHeaderProps<TItem extends ListItem> = {
58
58
59
59
/** Whether selecting multiple transactions at once is allowed */
60
60
canSelectMultiple : boolean | undefined ;
61
+
62
+ /** Callback passed as goToItem in actionCell, triggered by clicking actionButton */
63
+ handleOnButtonPress ?: ( ) => void ;
64
+
65
+ /** Whether the action button should be displayed */
66
+ shouldShowAction ?: boolean ;
61
67
} ;
62
68
63
69
type ReportCellProps = {
@@ -84,7 +90,16 @@ function TotalCell({showTooltip, isLargeScreenWidth, reportItem}: ReportCellProp
84
90
) ;
85
91
}
86
92
87
- function FirstHeaderRow < TItem extends ListItem > ( { policy, report : moneyRequestReport , item, onCheckboxPress, isDisabled, canSelectMultiple} : FirstRowReportHeaderProps < TItem > ) {
93
+ function FirstHeaderRow < TItem extends ListItem > ( {
94
+ policy,
95
+ report : moneyRequestReport ,
96
+ item,
97
+ onCheckboxPress,
98
+ isDisabled,
99
+ canSelectMultiple,
100
+ handleOnButtonPress = ( ) => { } ,
101
+ shouldShowAction = false ,
102
+ } : FirstRowReportHeaderProps < TItem > ) {
88
103
const styles = useThemeStyles ( ) ;
89
104
const StyleUtils = useStyleUtils ( ) ;
90
105
const reportItem = item as unknown as ReportListItemType ;
@@ -112,13 +127,23 @@ function FirstHeaderRow<TItem extends ListItem>({policy, report: moneyRequestRep
112
127
/>
113
128
</ View >
114
129
</ View >
115
- < View style = { [ styles . justifyContentEnd , styles . flexShrink0 ] } >
130
+ < View style = { [ styles . flexShrink0 , styles . mr3 ] } >
116
131
< TotalCell
117
132
showTooltip
118
133
isLargeScreenWidth = { false }
119
134
reportItem = { reportItem }
120
135
/>
121
136
</ View >
137
+ { shouldShowAction && (
138
+ < View style = { [ StyleUtils . getReportTableColumnStyles ( CONST . SEARCH . TABLE_COLUMNS . ACTION ) ] } >
139
+ < ActionCell
140
+ action = { reportItem . action }
141
+ goToItem = { handleOnButtonPress }
142
+ isSelected = { item . isSelected }
143
+ isLoading = { reportItem . isActionLoading }
144
+ />
145
+ </ View >
146
+ ) }
122
147
</ View >
123
148
) ;
124
149
}
@@ -185,6 +210,8 @@ function ReportListItemHeader<TItem extends ListItem>({
185
210
onCheckboxPress = { onCheckboxPress }
186
211
isDisabled = { isDisabled }
187
212
canSelectMultiple = { canSelectMultiple }
213
+ shouldShowAction
214
+ handleOnButtonPress = { handleOnButtonPress }
188
215
/>
189
216
< View style = { [ styles . mr3 , styles . ml3 , styles . pv2 ] } >
190
217
< View style = { [ styles . borderBottom ] } />
0 commit comments