import { RiBarcodeFill, RiCalendarLine, RiLoader4Line, RiMoneyDollarCircleLine, } from "@remixicon/react"; import { type BillDialogState, formatBillDateLabel, getBillStatusBadgeVariant, } from "@/features/dashboard/bills/bills-helpers"; import type { DashboardBill } from "@/features/dashboard/bills/bills-queries"; import MoneyValues from "@/shared/components/money-values"; import { PaymentSuccess } from "@/shared/components/payment-success"; import { Badge } from "@/shared/components/ui/badge"; import { Button } from "@/shared/components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/shared/components/ui/dialog"; type BillPaymentDialogProps = { bill: DashboardBill | null; open: boolean; modalState: BillDialogState; isPending: boolean; onClose: () => void; onConfirm: () => void; }; export function BillPaymentDialog({ bill, open, modalState, isPending, onClose, onConfirm, }: BillPaymentDialogProps) { const isProcessing = modalState === "processing" || isPending; const dueLabel = bill ? formatBillDateLabel(bill.dueDate, "Vencimento:") : null; return ( { if (nextOpen || isProcessing) { return; } onClose(); }} > { if (isProcessing) { event.preventDefault(); } }} onPointerDownOutside={(event) => { if (isProcessing) { event.preventDefault(); } }} > {modalState === "success" ? ( ) : ( <>
Confirmar pagamento Boleto
{bill ? (
{/* Card principal */}

Boleto

{bill.name}

{/* Métricas */}
Valor
Vencimento

{dueLabel?.replace("Vencimento: ", "") ?? "—"}

{/* Status */}
Status atual {bill.isSettled ? "Pago" : "Pendente"}
{/* Aviso */}

Você poderá editar o lançamento depois, se necessário.

) : null} )}
); }