refactor(admin, draws, settlement): unify admin datetime display and tighten wallet write permission
This commit is contained in:
@@ -9,7 +9,9 @@ import { buttonVariants } from "@/components/ui/button";
|
||||
import { AdminNoResourceState } from "@/components/admin/admin-no-resource-state";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { useAdminDateTimeFormatter } from "@/hooks/use-admin-datetime-formatter";
|
||||
import { formatAdminInstantInTimeZone } from "@/lib/admin-datetime";
|
||||
import { getAdminRequestLocale } from "@/lib/admin-locale";
|
||||
import { LOTTERY_SCHEDULE_TIMEZONE } from "@/lib/lottery-schedule-timezone";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { DrawCurrentSnapshot } from "@/types/api/public-draw";
|
||||
|
||||
@@ -62,7 +64,11 @@ export function DashboardCurrentDrawCard({
|
||||
loading = false,
|
||||
}: DashboardCurrentDrawCardProps): ReactElement {
|
||||
const { t } = useTranslation(["dashboard", "draws"]);
|
||||
const formatDt = useAdminDateTimeFormatter();
|
||||
const formatDt = (iso: string | null | undefined): string =>
|
||||
formatAdminInstantInTimeZone(iso, {
|
||||
locale: getAdminRequestLocale(),
|
||||
timeZone: LOTTERY_SCHEDULE_TIMEZONE,
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user