refactor(admin, draws, settlement): unify admin datetime display and tighten wallet write permission

This commit is contained in:
2026-06-09 15:06:52 +08:00
parent b7278e68a4
commit dfd475856e
10 changed files with 60 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next";
import type { SettlementAdjustmentRow } from "@/api/admin-agent-settlement";
import { AdminNoResourceState } from "@/components/admin/admin-no-resource-state";
import { AdminLoadingState } from "@/components/admin/admin-loading-state";
import { useAdminDateTimeFormatter } from "@/hooks/use-admin-datetime-formatter";
import { formatSettlementPeriodSpan } from "@/lib/agent-settlement-period-range";
import { formatDashboardMoneyMinor } from "@/modules/dashboard/use-dashboard-analytics";
import {
@@ -30,6 +31,7 @@ export function SettlementAdjustmentsTable({
onOpenBill,
}: SettlementAdjustmentsTableProps): React.ReactElement {
const { t } = useTranslation(["settlementCenter", "common"]);
const formatTs = useAdminDateTimeFormatter();
if (loading) {
return <AdminLoadingState />;
@@ -71,7 +73,7 @@ export function SettlementAdjustmentsTable({
{formatDashboardMoneyMinor(row.amount, currencyCode)}
</TableCell>
<TableCell className="max-w-[200px] truncate text-sm">{row.reason ?? "—"}</TableCell>
<TableCell className="text-xs text-muted-foreground">{row.created_at ?? "—"}</TableCell>
<TableCell className="text-xs text-muted-foreground">{formatTs(row.created_at)}</TableCell>
<TableCell>
{row.original_bill_id != null ? (
<button