File tree 1 file changed +4
-13
lines changed
src/routes/details/awsBreakdown/instances
1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,8 @@ const InstancesTable: React.FC<InstancesTableProps> = ({
129
129
} ,
130
130
] ;
131
131
132
- computedItems . map ( ( item , index ) => {
133
- const cost = getTotalCost ( item , index ) ;
132
+ computedItems . map ( item => {
133
+ const cost = getTotalCost ( item ) ;
134
134
const actions = getActions ( item ) ;
135
135
136
136
newRows . push ( {
@@ -208,19 +208,10 @@ const InstancesTable: React.FC<InstancesTableProps> = ({
208
208
) ;
209
209
} ;
210
210
211
- const getTotalCost = ( item : ComputedReportItem , index : number ) => {
212
- const cost = report ?. meta ?. total ?. cost ?. total ? report . meta . total . cost . total . value : 0 ;
211
+ const getTotalCost = ( item : ComputedReportItem ) => {
213
212
const value = item . cost ?. total ?. value || 0 ;
214
213
const units = item . cost ?. total ?. units || 'USD' ;
215
- const percentValue = cost === 0 ? cost . toFixed ( 2 ) : ( ( value / cost ) * 100 ) . toFixed ( 2 ) ;
216
- return (
217
- < >
218
- { formatCurrency ( value , units ) }
219
- < div style = { styles . infoDescription } key = { `total-cost-${ index } ` } >
220
- { intl . formatMessage ( messages . percentOfCost , { value : percentValue } ) }
221
- </ div >
222
- </ >
223
- ) ;
214
+ return formatCurrency ( value , units ) ;
224
215
} ;
225
216
226
217
const handleOnSort = ( sortType : string , isSortAscending : boolean ) => {
You can’t perform that action at this time.
0 commit comments