refactor: update agent API schemas, standardize UI text styling, and enhance settlement credit ledger components

This commit is contained in:
2026-06-11 18:02:02 +08:00
parent 44ad51698f
commit 1eb6702c51
54 changed files with 1888 additions and 1103 deletions

View File

@@ -93,11 +93,13 @@ export function AdminBreadcrumb() {
const navItem = navItems
.filter(
(item) =>
pathname === item.href ||
pathname.startsWith(`${item.href}/`) ||
(item.activeMatchPrefix != null &&
(pathname === item.activeMatchPrefix ||
pathname.startsWith(`${item.activeMatchPrefix}/`))),
(item.activeExact === true
? pathname === item.href
: pathname === item.href ||
pathname.startsWith(`${item.href}/`) ||
(item.activeMatchPrefix != null &&
(pathname === item.activeMatchPrefix ||
pathname.startsWith(`${item.activeMatchPrefix}/`)))),
)
.sort((a, b) => b.href.length - a.href.length)[0];

View File

@@ -75,7 +75,7 @@ export function AdminTableNoResourceRow({
compact?: boolean;
}): ReactElement {
return (
<TableRow className={className}>
<TableRow className={cn("hover:bg-transparent", className)}>
<TableCell colSpan={colSpan} className={cn("text-muted-foreground", cellClassName)}>
<AdminNoResourceState message={message} compact={compact} />
</TableCell>

View File

@@ -34,9 +34,12 @@ const SUB_NAV =
function isActive(
pathname: string,
item: { href: string; activeMatchPrefix?: string; segment?: string },
item: { href: string; activeMatchPrefix?: string; activeExact?: boolean; segment?: string },
): boolean {
const { href, activeMatchPrefix, segment } = item;
const { href, activeMatchPrefix, activeExact, segment } = item;
if (activeExact) {
return pathname === href;
}
const prefix = activeMatchPrefix ?? href;
if (prefix === ADMIN_BASE || prefix === `${ADMIN_BASE}/`) {
return pathname === ADMIN_BASE || pathname === `${ADMIN_BASE}/`;

View File

@@ -54,16 +54,7 @@ export function PlayerLedgerSourceBadge({
return null;
}
const sourceClass =
ledgerSource === "wallet_txn"
? "border-sky-200 bg-sky-50 text-sky-900"
: ledgerSource === "payment_record"
? "border-emerald-200 bg-emerald-50 text-emerald-900"
: ledgerSource === "settlement_adjustment"
? "border-amber-200 bg-amber-50 text-amber-900"
: ledgerSource === "share_ledger"
? "border-indigo-200 bg-indigo-50 text-indigo-900"
: "border-violet-200 bg-violet-50 text-violet-900";
const sourceClass = "border-border bg-muted/30 text-muted-foreground";
const label =
ledgerSource === "wallet_txn"