Skip to content

Commit e313264

Browse files
committed
chore: prevent showing the total profit when it is zero
1 parent 7f38971 commit e313264

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/app/[locale]/(main)/(container)/cart/hooks/useCheckoutItems.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ const useCheckoutItems = ({ content }: { content: CartContentFragment }) => {
107107
/>
108108
),
109109
},
110-
{
110+
];
111+
112+
if (totalProfit > 0) {
113+
items.push({
111114
key: (
112115
<Typography color="error" variant="body2" sx={{ fontWeight: 600 }}>
113116
{t('pages.cart.box.yourProfit')}
@@ -122,8 +125,8 @@ const useCheckoutItems = ({ content }: { content: CartContentFragment }) => {
122125
}}
123126
/>
124127
),
125-
},
126-
];
128+
});
129+
}
127130

128131
return items;
129132
};

0 commit comments

Comments
 (0)