refactor: 合并多语言支持的显示名称字段,优化奖池手动爆发功能的返回数据结构,增强管理端权限控制
This commit is contained in:
44
src/components/admin/admin-page-card.tsx
Normal file
44
src/components/admin/admin-page-card.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type AdminPageCardProps = {
|
||||
title: string;
|
||||
description?: string;
|
||||
actions?: ReactNode;
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
contentClassName?: string;
|
||||
/** 页内锚点(如 #records) */
|
||||
id?: string;
|
||||
};
|
||||
|
||||
/** 与列表/运营台一致的 admin-list-card 外层,用于设置、奖池等多区块页。 */
|
||||
export function AdminPageCard({
|
||||
title,
|
||||
description,
|
||||
actions,
|
||||
children,
|
||||
className,
|
||||
contentClassName,
|
||||
id,
|
||||
}: AdminPageCardProps) {
|
||||
return (
|
||||
<Card id={id} className={cn("admin-list-card scroll-mt-24", className)}>
|
||||
<CardHeader
|
||||
className={cn(
|
||||
"admin-list-header",
|
||||
actions != null && "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
||||
)}
|
||||
>
|
||||
<div className="min-w-0 space-y-1">
|
||||
<CardTitle className="admin-list-title">{title}</CardTitle>
|
||||
{description ? <CardDescription className="text-sm">{description}</CardDescription> : null}
|
||||
</div>
|
||||
{actions ? <div className="flex shrink-0 flex-wrap items-center gap-2">{actions}</div> : null}
|
||||
</CardHeader>
|
||||
<CardContent className={cn("admin-list-content", contentClassName)}>{children}</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user