refactor: 合并多语言支持的显示名称字段,优化奖池手动爆发功能的返回数据结构,增强管理端权限控制
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { useConfirmAction } from "@/hooks/use-confirm-action";
|
||||
import { useAdminDateTimeFormatter } from "@/hooks/use-admin-datetime-formatter";
|
||||
import { adminHasAnyPermission } from "@/lib/admin-permissions";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -79,6 +80,7 @@ function reconcileTypeLabel(type: string, t: (key: string) => string): string {
|
||||
|
||||
export function ReconcileConsole(): React.ReactElement {
|
||||
const { t } = useTranslation(["reconcile", "common"]);
|
||||
const { request: requestConfirm, ConfirmDialog } = useConfirmAction();
|
||||
const profile = useAdminProfile();
|
||||
const canCreate = adminHasAnyPermission(profile?.permissions, [...MANAGE]);
|
||||
const formatTs = useAdminDateTimeFormatter();
|
||||
@@ -240,7 +242,22 @@ export function ReconcileConsole(): React.ReactElement {
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Button type="button" className="w-full lg:w-auto" onClick={() => void onCreate()} disabled={submitting}>
|
||||
<Button
|
||||
type="button"
|
||||
className="w-full lg:w-auto"
|
||||
disabled={submitting}
|
||||
onClick={() =>
|
||||
requestConfirm({
|
||||
title: t("confirmCreateTitle"),
|
||||
description: t("confirmCreateDescription", {
|
||||
playerHint: selectedPlayer
|
||||
? t("confirmCreatePlayer")
|
||||
: t("confirmCreateAllPlayers"),
|
||||
}),
|
||||
onConfirm: () => onCreate(),
|
||||
})
|
||||
}
|
||||
>
|
||||
{submitting ? t("submitting") : t("createTask")}
|
||||
</Button>
|
||||
</div>
|
||||
@@ -532,6 +549,7 @@ export function ReconcileConsole(): React.ReactElement {
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
<ConfirmDialog />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user