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:
@@ -21,6 +21,7 @@ import {
|
||||
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { AdminNoResourceState, AdminTableNoResourceRow } from "@/components/admin/admin-no-resource-state";
|
||||
import { AdminMoneyDisplay } from "@/components/admin/admin-money-display";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import {
|
||||
ChartContainer,
|
||||
@@ -37,6 +38,7 @@ import {
|
||||
} from "@/lib/money";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { SignedMoney, signedMoneyClass } from "@/lib/admin-signed-money";
|
||||
import { adminMoneyDisplayClass } from "@/lib/admin-money-display";
|
||||
import {
|
||||
buildBatchProgressConfig,
|
||||
buildFinanceStructureConfig,
|
||||
@@ -68,7 +70,7 @@ type DashboardFinanceMetricCell = {
|
||||
emphasize: boolean;
|
||||
};
|
||||
|
||||
/** KPI 卡片底部三列:仅数字(币种见卡片主值),过长时省略号 + hover 看全称 */
|
||||
/** KPI 卡片底部三列:仅数字(币种见卡片主值),过长时缩小字号 + 换行 */
|
||||
function formatDashboardMetricAmount(
|
||||
minor: number,
|
||||
currencyCode: string | null,
|
||||
@@ -115,7 +117,8 @@ function DashboardFinanceMetricCells({
|
||||
</p>
|
||||
<p
|
||||
className={cn(
|
||||
"mt-1 truncate text-center text-[10px] font-bold tabular-nums leading-tight",
|
||||
"mt-1 text-center font-bold tabular-nums leading-tight break-all",
|
||||
adminMoneyDisplayClass(display, { size: "sm", emphasize: true }),
|
||||
cell.emphasize ? "text-foreground" : "text-muted-foreground",
|
||||
)}
|
||||
title={title}
|
||||
@@ -241,9 +244,14 @@ export function DashboardScopeMetric({
|
||||
return (
|
||||
<div className="rounded-lg border bg-muted/30 px-3 py-2.5">
|
||||
<p className="text-xs text-muted-foreground">{label}</p>
|
||||
<p className="mt-1 break-all text-base font-semibold tabular-nums leading-tight text-foreground">
|
||||
<AdminMoneyDisplay
|
||||
as="p"
|
||||
value={value}
|
||||
size="md"
|
||||
className="mt-1 text-foreground"
|
||||
>
|
||||
{value}
|
||||
</p>
|
||||
</AdminMoneyDisplay>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -303,8 +311,11 @@ export function DashboardKpiCard({
|
||||
<p
|
||||
title={valueTitle}
|
||||
className={cn(
|
||||
"mt-2 break-words text-base font-bold tabular-nums leading-tight tracking-tight sm:text-lg",
|
||||
resolvedValueClassName ?? "text-foreground",
|
||||
"mt-2 text-foreground",
|
||||
resolvedValueClassName,
|
||||
typeof resolvedValue === "string"
|
||||
? adminMoneyDisplayClass(resolvedValue, { size: "lg", emphasize: true })
|
||||
: "min-w-0 break-all text-base font-bold tabular-nums leading-tight tracking-tight sm:text-lg",
|
||||
)}
|
||||
>
|
||||
{resolvedValue}
|
||||
@@ -418,9 +429,21 @@ export function StatCard({
|
||||
</div>
|
||||
<div className="flex min-h-0 min-w-0 flex-1 flex-col">
|
||||
<p className="text-sm font-medium text-muted-foreground">{label}</p>
|
||||
<p className="mt-1 text-2xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{value}
|
||||
</p>
|
||||
{typeof value === "string" || typeof value === "number" ? (
|
||||
<AdminMoneyDisplay
|
||||
as="p"
|
||||
value={String(value)}
|
||||
size="xl"
|
||||
emphasize
|
||||
className="mt-1 text-foreground"
|
||||
>
|
||||
{value}
|
||||
</AdminMoneyDisplay>
|
||||
) : (
|
||||
<p className="mt-1 text-2xl font-bold tabular-nums tracking-tight text-foreground">
|
||||
{value}
|
||||
</p>
|
||||
)}
|
||||
{deltaLabel ? (
|
||||
<p className="mt-1 text-xs font-medium tabular-nums">{deltaLabel}</p>
|
||||
) : null}
|
||||
@@ -557,6 +580,16 @@ export function DashboardPanelCard({
|
||||
<p className="text-xs font-medium text-muted-foreground">{title}</p>
|
||||
{loading ? (
|
||||
<Skeleton className="mt-2 h-8 w-24 rounded-md" />
|
||||
) : typeof value === "string" || typeof value === "number" ? (
|
||||
<AdminMoneyDisplay
|
||||
as="p"
|
||||
value={String(value)}
|
||||
size="xl"
|
||||
emphasize
|
||||
className="mt-1 text-foreground"
|
||||
>
|
||||
{value}
|
||||
</AdminMoneyDisplay>
|
||||
) : (
|
||||
<p className="mt-1 text-2xl font-bold tabular-nums leading-none tracking-tight text-foreground">
|
||||
{value}
|
||||
|
||||
Reference in New Issue
Block a user