refactor: 合并多语言支持的显示名称字段,优化奖池手动爆发功能的返回数据结构,增强管理端权限控制
This commit is contained in:
@@ -4,12 +4,13 @@ import { useCallback, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { getAdminDraw } from "@/api/admin-draws";
|
||||
import { drawStatusLabel, hallPreviewDiffersFromDbStatus } from "@/modules/draws/draw-display";
|
||||
import { DrawStatusBadge } from "@/modules/draws/draw-status-badge";
|
||||
import { LotteryApiBizError } from "@/types/api/errors";
|
||||
import type { AdminDrawShowData } from "@/types/api/admin-draws";
|
||||
|
||||
export function RiskDrawHeader({ drawId }: { drawId: number }) {
|
||||
const { t } = useTranslation("risk");
|
||||
const { t } = useTranslation(["risk", "draws"]);
|
||||
const [draw, setDraw] = useState<AdminDrawShowData | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
@@ -47,10 +48,19 @@ export function RiskDrawHeader({ drawId }: { drawId: number }) {
|
||||
</h1>
|
||||
<p className="flex flex-wrap items-center gap-2 text-sm text-muted-foreground">
|
||||
<span>{t("databaseStatus")}</span>
|
||||
<DrawStatusBadge status={draw.status} />
|
||||
<span className="text-xs opacity-80">
|
||||
{t("hallPreviewStatus", { status: draw.hall_preview_status })}
|
||||
</span>
|
||||
<DrawStatusBadge
|
||||
status={draw.status}
|
||||
label={drawStatusLabel(draw.status, t)}
|
||||
/>
|
||||
{hallPreviewDiffersFromDbStatus(draw.status, draw.hall_preview_status) ? (
|
||||
<>
|
||||
<span>{t("hallPreviewStatusLabel", { ns: "draws" })}</span>
|
||||
<DrawStatusBadge
|
||||
status={draw.hall_preview_status}
|
||||
label={drawStatusLabel(draw.hall_preview_status, t)}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user