mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 02:51:46 +00:00
- 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>
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import type {
|
|
DashboardInvoice,
|
|
InvoicePaymentAccountOption,
|
|
} from "@/features/dashboard/invoices/invoices-queries";
|
|
import { useInvoicesWidgetController } from "@/features/dashboard/invoices/use-invoices-widget-controller";
|
|
import { InvoicesWidgetView } from "../invoices/invoices-widget-view";
|
|
|
|
type InvoicesWidgetProps = {
|
|
invoices: DashboardInvoice[];
|
|
paymentAccountOptions: InvoicePaymentAccountOption[];
|
|
};
|
|
|
|
export function InvoicesWidget({
|
|
invoices,
|
|
paymentAccountOptions,
|
|
}: InvoicesWidgetProps) {
|
|
const {
|
|
items,
|
|
selectedInvoice,
|
|
isModalOpen,
|
|
modalState,
|
|
isPending,
|
|
paymentAccountId,
|
|
setPaymentAccountId,
|
|
paymentDate,
|
|
setPaymentDate,
|
|
openPaymentDialog,
|
|
closePaymentDialog,
|
|
confirmPayment,
|
|
} = useInvoicesWidgetController(invoices);
|
|
|
|
return (
|
|
<InvoicesWidgetView
|
|
invoices={items}
|
|
selectedInvoice={selectedInvoice}
|
|
isModalOpen={isModalOpen}
|
|
modalState={modalState}
|
|
isPending={isPending}
|
|
paymentAccountId={paymentAccountId}
|
|
onPaymentAccountChange={setPaymentAccountId}
|
|
paymentDate={paymentDate}
|
|
onPaymentDateChange={setPaymentDate}
|
|
paymentAccountOptions={paymentAccountOptions}
|
|
onOpenPaymentDialog={openPaymentDialog}
|
|
onClosePaymentDialog={closePaymentDialog}
|
|
onConfirmPayment={confirmPayment}
|
|
/>
|
|
);
|
|
}
|