import Price from 'components/price'; type DiscountGroup = { discount: { amount: number; minimumSpent: number; }; }; export default function TierDiscount({ tieredDiscount }: { tieredDiscount: any }) { if (!tieredDiscount) { return; } const { discountGroups, discountAmount, spentToNextDiscount, minSpent, nextDiscount, subTotal, currencyCode } = tieredDiscount; return ( <>
{spentToNextDiscount > 0 && ( <> Spent more than )} {nextDiscount && to get {nextDiscount * 100}%}
{discountGroups.map((group: DiscountGroup, i: number) => (
))}

{spentToNextDiscount === 0 ? ( Congratulations you got {discountAmount}% Discounts! ) : ( You got : {discountAmount}% off )}

); }