import { RiBarcodeFill, RiCheckboxCircleLine, RiLoader4Line, RiMoneyDollarCircleLine, } from "@remixicon/react"; import MoneyValues from "@/components/shared/money-values"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import type { DashboardBill } from "@/lib/dashboard/bills"; import { type BillDialogState, formatBillDateLabel, getBillStatusBadgeVariant, } from "@/lib/dashboard/bills-helpers"; 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" ? (
Pagamento registrado! Atualizamos o status do boleto para pago. Em instantes ele aparecerá como baixado no histórico.
) : ( <> Confirmar pagamento do boleto Confirme os dados para registrar o pagamento. Você poderá editar o lançamento depois, se necessário. {bill ? (

Boleto

{bill.name}

{dueLabel ? (

{dueLabel}

) : null}
Valor do Boleto
Status
{bill.isSettled ? "Pago" : "Pendente"}
) : null} )}
); }