refactor(admin-reports, i18n): remove rebate commission report and enhance localization

Removed the `getAdminReportRebateCommission` function and its references from the admin reports API and localization files. Updated CSS for improved money display handling in admin components. Enhanced localization support by adding new finance and support workspace entries in English, Nepali, and Chinese, improving user experience across the application.
This commit is contained in:
2026-06-16 16:04:03 +08:00
parent d4cf4ff436
commit a020e34a7d
38 changed files with 1259 additions and 353 deletions

View File

@@ -0,0 +1,57 @@
"use client";
import type { ElementType, ReactElement, ReactNode } from "react";
import {
adminMoneyDisplayClass,
adminMoneyDisplayTitle,
type AdminMoneyDisplaySize,
} from "@/lib/admin-money-display";
import { cn } from "@/lib/utils";
export type AdminMoneyDisplayProps = {
children: ReactNode;
/** 用于自适应字号与 hover 完整值;缺省时从 string children 推断 */
value?: string | number | null;
size?: AdminMoneyDisplaySize;
emphasize?: boolean;
className?: string;
title?: string;
as?: ElementType;
};
/** 卡片/摘要区金额:自适应字号 + 换行,禁止 truncate 裁切 */
export function AdminMoneyDisplay({
children,
value,
size = "lg",
emphasize = true,
className,
title,
as: Component = "span",
}: AdminMoneyDisplayProps): ReactElement {
const resolvedValue =
value != null
? String(value)
: typeof children === "string" || typeof children === "number"
? String(children)
: "";
const resolvedTitle = title ?? adminMoneyDisplayTitle(resolvedValue);
return (
<Component
title={resolvedTitle}
className={cn(
resolvedValue
? adminMoneyDisplayClass(resolvedValue, { size, emphasize, className })
: cn(
"min-w-0 whitespace-normal break-words [overflow-wrap:anywhere] tabular-nums leading-tight tracking-tight",
emphasize ? "font-semibold" : "font-medium",
className,
),
)}
>
{children}
</Component>
);
}