diff --git a/frontend/providers/costcenter/src/components/RechargeModal.tsx b/frontend/providers/costcenter/src/components/RechargeModal.tsx index 259f0743dda..24529ddc6b6 100644 --- a/frontend/providers/costcenter/src/components/RechargeModal.tsx +++ b/frontend/providers/costcenter/src/components/RechargeModal.tsx @@ -662,27 +662,40 @@ const RechargeModal = forwardRef( {steps && ratios && steps.length === ratios.length && - steps.map((step, idx) => ( - <> - - {step + '<='} - {t('Recharge Amount')} - {idx < steps.length - 1 ? `< ${steps[idx + 1]}` : ''} - - - {t('Bonus')} - {ratios[idx].toFixed(2)}% - - - ))} + steps + .map( + (step, idx, steps) => + [ + step, + idx < steps.length - 1 ? steps[idx + 1] : undefined, + ratios[idx] + ] as const + ) + .filter(([_, _2, ratio], idx) => { + return ratio > 0; + }) + .map(([pre, next, ratio], idx) => ( + <> + + {pre} + {' <= '} + {t('Recharge Amount')} + {next ? `< ${next}` : ''} + + + {t('Bonus')} + {ratio.toFixed(2)}% + + + ))} {specialBonus && specialBonus.map(([k, v], i) => ( <> - - {k + '='} {t('Recharge Amount')}{' '} + + {k} = {t('Recharge Amount')}{' '} - - {t('Bonus')} {v} + + {t('Bonus')} {v} % ))}