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

@@ -18,6 +18,7 @@ import {
import { getAdminDashboard } from "@/api/admin-dashboard";
import { useAsyncEffect } from "@/hooks/use-async-effect";
import { useAdminDateTimeFormatter } from "@/hooks/use-admin-datetime-formatter";
import { useTranslationRef } from "@/hooks/use-translation-ref";
import { useCachedPlayTypeOptions } from "@/hooks/use-cached-play-type-options";
import { useAdminCurrencyCatalog } from "@/hooks/use-admin-currency-catalog";
@@ -50,6 +51,7 @@ import { LotteryApiBizError } from "@/types/api/errors";
export function AgentDashboardConsole(): ReactElement {
const { t, i18n } = useTranslation(["dashboard", "common", "agents"]);
const tRef = useTranslationRef(["dashboard", "common"]);
const formatDt = useAdminDateTimeFormatter();
const profile = useAdminProfile();
const agent = profile?.agent ?? null;
const permissions = useMemo(() => profile?.permissions ?? [], [profile?.permissions]);
@@ -252,7 +254,7 @@ export function AgentDashboardConsole(): ReactElement {
<span>{t("agent.settlementCycle", { cycle: overview.settlement_cycle })}</span>
<span>
{overview.latest_bet_at
? t("agent.latestBetAt", { time: new Date(overview.latest_bet_at).toLocaleString() })
? t("agent.latestBetAt", { time: formatDt(overview.latest_bet_at) })
: t("agent.noBetToday")}
</span>
</div>