update payment details

This commit is contained in:
2026-01-15 14:21:11 -03:00
parent 906dde027c
commit 5f53ffb4a7
7 changed files with 241 additions and 129 deletions

View File

@@ -8,6 +8,8 @@ import { z } from 'zod'
import valid from 'card-validator'
import { Currency } from '@repo/ui/components/currency'
import { Kbd } from '@repo/ui/components/ui/kbd'
import { Abbr } from '@repo/ui/components/abbr'
import { Button } from '@repo/ui/components/ui/button'
import { Separator } from '@repo/ui/components/ui/separator'
import { Spinner } from '@repo/ui/components/ui/spinner'
@@ -73,7 +75,7 @@ type ReviewProps = {
export function Review({ onSubmit }: ReviewProps) {
const wizard = useWizard()
const { items, summary, address } = useWizardStore()
const { items, summary, address, coupon } = useWizardStore()
const { subtotal, discount, interest_amount, total } = summary()
const [loading, { set }] = useToggle()
@@ -127,8 +129,15 @@ export function Review({ onSubmit }: ReviewProps) {
</TableRow>
{/* Discount */}
<TableRow>
<TableCell className="text-right" colSpan={3}>
Descontos
<TableCell colSpan={3}>
<span className="flex gap-1 justify-end">
Descontos
{coupon && (
<Kbd>
<Abbr maxLen={8}>{coupon.code}</Abbr>
</Kbd>
)}
</span>
</TableCell>
<TableCell>
<Currency>{discount}</Currency>