CouponInput

Domain

Coupon code input with apply/remove flow. Calls onApply which returns success/error; shows applied state once a valid code is accepted.

Default (try SAVE20)

Preview

Have a coupon?

Try: SAVE20

Code
<CouponInput onApply={async (code) => validateCoupon(code)} />

Applied state

Preview

Have a coupon?

SAVE20 applied
Code
<CouponInput appliedCode="SAVE20" onApply={handleApply} onRemove={handleRemove} />
Sourcemodules/domains/common/discount/CouponInput.tsx