Files
openmonetis/src/features/dashboard/components/invoices/invoices-widget-view.tsx
Felipe Coutinho 0f5c735be0 feat(dashboard): confirmação de pagamento com conta e data para faturas e boletos
- widget de faturas abre modal com seleção de conta de origem e data antes de pagar
- widget de boletos ganha a mesma paridade: modal com conta de pagamento e data
- toggleTransactionSettlementAction aceita paymentAccountId e paymentDate opcionais
- DashboardBill expõe accountId para inicializar o modal com a conta já vinculada

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 22:08:16 +00:00

62 lines
1.7 KiB
TypeScript

import type { InvoiceDialogState } from "@/features/dashboard/invoices/invoices-helpers";
import type {
DashboardInvoice,
InvoicePaymentAccountOption,
} from "@/features/dashboard/invoices/invoices-queries";
import { InvoicePaymentDialog } from "./invoice-payment-dialog";
import { InvoicesList } from "./invoices-list";
type InvoicesWidgetViewProps = {
invoices: DashboardInvoice[];
selectedInvoice: DashboardInvoice | null;
isModalOpen: boolean;
modalState: InvoiceDialogState;
isPending: boolean;
paymentAccountId: string;
onPaymentAccountChange: (accountId: string) => void;
paymentDate: Date;
onPaymentDateChange: (date: Date) => void;
paymentAccountOptions: InvoicePaymentAccountOption[];
onOpenPaymentDialog: (invoiceId: string) => void;
onClosePaymentDialog: () => void;
onConfirmPayment: () => void;
};
export function InvoicesWidgetView({
invoices,
selectedInvoice,
isModalOpen,
modalState,
isPending,
paymentAccountId,
onPaymentAccountChange,
paymentDate,
onPaymentDateChange,
paymentAccountOptions,
onOpenPaymentDialog,
onClosePaymentDialog,
onConfirmPayment,
}: InvoicesWidgetViewProps) {
return (
<>
<div className="flex flex-col gap-4">
<InvoicesList invoices={invoices} onPay={onOpenPaymentDialog} />
</div>
<InvoicePaymentDialog
invoice={selectedInvoice}
open={isModalOpen}
modalState={modalState}
isPending={isPending}
paymentAccountId={paymentAccountId}
onPaymentAccountChange={onPaymentAccountChange}
paymentDate={paymentDate}
onPaymentDateChange={onPaymentDateChange}
paymentAccountOptions={paymentAccountOptions}
onClose={onClosePaymentDialog}
onConfirm={onConfirmPayment}
/>
</>
);
}