refactor: 合并多语言支持的显示名称字段,优化奖池手动爆发功能的返回数据结构,增强管理端权限控制
This commit is contained in:
@@ -8,6 +8,8 @@ import { cn } from "@/lib/utils";
|
||||
|
||||
type ConfigVersionActionsProps = {
|
||||
isDraft: boolean;
|
||||
/** 为 false 时仅保留刷新,隐藏新建/保存/发布(只读权限) */
|
||||
canManage?: boolean;
|
||||
loadingList?: boolean;
|
||||
loadingDetail?: boolean;
|
||||
saving?: boolean;
|
||||
@@ -21,6 +23,7 @@ type ConfigVersionActionsProps = {
|
||||
|
||||
export function ConfigVersionActions({
|
||||
isDraft,
|
||||
canManage = true,
|
||||
loadingList = false,
|
||||
loadingDetail = false,
|
||||
saving = false,
|
||||
@@ -41,11 +44,13 @@ export function ConfigVersionActions({
|
||||
<RefreshCw className={loadingList ? "size-4 animate-spin" : "size-4"} aria-hidden />
|
||||
{loadingList ? t("versionActions.refreshing") : t("versionActions.refresh")}
|
||||
</Button>
|
||||
<Button type="button" disabled={saving} onClick={onNewDraft}>
|
||||
<Plus className="size-4" aria-hidden />
|
||||
{t("versionActions.newDraft")}
|
||||
</Button>
|
||||
{isDraft ? (
|
||||
{canManage ? (
|
||||
<Button type="button" disabled={saving} onClick={onNewDraft}>
|
||||
<Plus className="size-4" aria-hidden />
|
||||
{t("versionActions.newDraft")}
|
||||
</Button>
|
||||
) : null}
|
||||
{canManage && isDraft ? (
|
||||
<>
|
||||
<Button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user