feat(agents, config, dashboard, i18n): add agent line provision wizard, site deletion, and site dashboard with multi-language support
Added agent line provision wizard page with permission gating, replacing redirect placeholder. Introduced site deletion API and UI with confirmation dialog in integration sites management. Added new site-scoped dashboard panel showing bet metrics, P/L trends, active players, and quick links. Enhanced chart tooltip to support custom formatters and fix indicator color
This commit is contained in:
@@ -8,9 +8,12 @@ import { AdminNoResourceState } from "@/components/admin/admin-no-resource-state
|
||||
import { AdminLoadingState } from "@/components/admin/admin-loading-state";
|
||||
import { AdminRowActionsMenu } from "@/components/admin/admin-row-actions-menu";
|
||||
import { AdminStatusBadge } from "@/components/admin/admin-status-badge";
|
||||
import { signedMoneyClass } from "@/lib/admin-signed-money";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { formatSettlementPeriodSpan } from "@/lib/agent-settlement-period-range";
|
||||
import { formatDashboardMoneyMinor } from "@/modules/dashboard/use-dashboard-analytics";
|
||||
import {
|
||||
formatSignedSettlementMoney,
|
||||
} from "@/modules/settlement/settlement-signed-money";
|
||||
import {
|
||||
describeBillPaymentDirection,
|
||||
} from "@/modules/settlement/settlement-bill-display";
|
||||
@@ -76,26 +79,6 @@ function billTypeTone(row: SettlementBillRow): string {
|
||||
return "border-border/70 bg-muted/25 text-muted-foreground";
|
||||
}
|
||||
|
||||
function signedMoneyClass(amount: number, emphasize = false): string {
|
||||
if (amount < 0) {
|
||||
return cn("text-destructive", emphasize && "font-medium");
|
||||
}
|
||||
if (amount > 0) {
|
||||
return cn("text-emerald-700", emphasize && "font-medium");
|
||||
}
|
||||
|
||||
return "text-muted-foreground";
|
||||
}
|
||||
|
||||
function formatSignedMoney(amount: number, currencyCode: string): string {
|
||||
if (amount === 0) {
|
||||
return formatDashboardMoneyMinor(0, currencyCode);
|
||||
}
|
||||
|
||||
const prefix = amount < 0 ? "−" : "+";
|
||||
return `${prefix}${formatDashboardMoneyMinor(Math.abs(amount), currencyCode)}`;
|
||||
}
|
||||
|
||||
function unpaidMoneyClass(row: SettlementBillRow): string {
|
||||
if (row.unpaid_amount <= 0) {
|
||||
return "text-muted-foreground";
|
||||
@@ -253,7 +236,7 @@ export function SettlementBillsTable({
|
||||
)}
|
||||
>
|
||||
{row.gross_win_loss != null ? (
|
||||
<div>{formatSignedMoney(row.gross_win_loss, currencyCode)}</div>
|
||||
<div>{formatSignedSettlementMoney(row.gross_win_loss, currencyCode)}</div>
|
||||
) : (
|
||||
"—"
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user