fix(dashboard, settlement): update analytics scope and enhance settlement operations panel
Added 'agentNodeId' to the analytics scope in the SiteDashboardConsole for improved data handling. Introduced 'lastPage' calculation in the SettlementOperationsPanel to enhance pagination logic. Updated wallet console to use the TFunction type for better type safety in translation functions.
This commit is contained in:
@@ -14,6 +14,7 @@ import { formatSettlementPeriodSpan } from "@/lib/agent-settlement-period-range"
|
||||
import {
|
||||
formatSignedSettlementMoney,
|
||||
} from "@/modules/settlement/settlement-signed-money";
|
||||
import { formatDashboardMoneyMinor } from "@/modules/dashboard/use-dashboard-analytics";
|
||||
import {
|
||||
describeBillPaymentDirection,
|
||||
} from "@/modules/settlement/settlement-bill-display";
|
||||
|
||||
@@ -211,6 +211,7 @@ export function SettlementOperationsPanel({
|
||||
);
|
||||
|
||||
const total = filteredRows.length;
|
||||
const lastPage = Math.max(1, Math.ceil(total / perPage));
|
||||
const pageRows = filteredRows.slice((page - 1) * perPage, page * perPage);
|
||||
|
||||
const operationTypeLabel = (value: OperationTypeFilter): string => {
|
||||
@@ -402,9 +403,12 @@ export function SettlementOperationsPanel({
|
||||
|
||||
{!loading && total > 0 ? (
|
||||
<AdminListPaginationFooter
|
||||
selectId="settlement-operations-per-page"
|
||||
page={page}
|
||||
perPage={perPage}
|
||||
total={total}
|
||||
lastPage={lastPage}
|
||||
loading={loading}
|
||||
onPageChange={setPage}
|
||||
onPerPageChange={(value) => {
|
||||
setPerPage(value);
|
||||
|
||||
Reference in New Issue
Block a user