fix(spa): use couponError to fix build warning

This commit is contained in:
Your Name committed 2026-06-06 20:14:43 +07:00
1 parent a1064a027b
commit 7e6c70b82b
1 file changed
+18 -15
+18 -15
View File
@@ -207,21 +207,24 @@ function CartDrawerFooter({ subtotal, onClose, t }: { subtotal: number; onClose:
{/* Coupon Input */} {/* Coupon Input */}
{!savedCoupon && ( {!savedCoupon && (
<div className="flex gap-2"> <div className="flex flex-col gap-1">
<input <div className="flex gap-2">
type="text" <input
value={couponInput} type="text"
onChange={e => setCouponInput(e.target.value.toUpperCase())} value={couponInput}
placeholder={t('cart.couponPlaceholder', 'Discount Code')} onChange={e => setCouponInput(e.target.value.toUpperCase())}
className="flex-1 bg-white border border-spa-stone/20 rounded-lg px-3 py-2 text-sm text-pop-black focus:border-spa-forest outline-none uppercase tracking-widest placeholder:text-spa-stone/50" placeholder={t('cart.couponPlaceholder', 'Discount Code')}
/> className="flex-1 bg-white border border-spa-stone/20 rounded-lg px-3 py-2 text-sm text-pop-black focus:border-spa-forest outline-none uppercase tracking-widest placeholder:text-spa-stone/50"
<button />
onClick={handleApplyCoupon} <button
disabled={couponLoading || !couponInput.trim()} onClick={handleApplyCoupon}
className="px-4 bg-spa-stone/10 hover:bg-spa-stone/20 border border-spa-stone/10 rounded-lg text-xs font-bold uppercase tracking-widest disabled:opacity-50 transition-all text-pop-black" disabled={couponLoading || !couponInput.trim()}
> className="px-4 bg-spa-stone/10 hover:bg-spa-stone/20 border border-spa-stone/10 rounded-lg text-xs font-bold uppercase tracking-widest disabled:opacity-50 transition-all text-pop-black"
{couponLoading ? '...' : t('cart.applyCoupon', 'Apply')} >
</button> {couponLoading ? '...' : t('cart.applyCoupon', 'Apply')}
</button>
</div>
{couponError && <span className="text-xs text-rose-500 font-medium">{couponError}</span>}
</div> </div>
)} )}