Files
lotteryAdmin/src/modules/config/config-doc-page.tsx
kang 0d984b00f0
Some checks failed
lotteryadmin CI / build (push) Has been cancelled
feat(admin): 仪表盘重构、代理线路修复与后台体验优化
- 各角色仪表盘:KPI 可点击跳转、快捷入口、去重冗余区块,代理/站点降级 analytics
- 代理线路:创建玩家权限、侧栏搜索、深链 URL、档案保存与删除预检等修复
- 统一密码最短 6 位;代理模块表格/侧栏背景色一致(admin-table-inset)
- 报表、钱包、对账、开奖、结算、配置等模块结构与 i18n 同步更新
2026-06-26 14:39:22 +08:00

78 lines
2.1 KiB
TypeScript

"use client";
import type { ReactNode } from "react";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { cn } from "@/lib/utils";
type ConfigDocPageProps = {
title: string;
titleSuffix?: ReactNode;
description?: string;
/** Category / play-type chips etc., rendered above the version toolbar. */
filters?: ReactNode;
toolbar?: ReactNode;
/** @deprecated Pass `footer` on `ConfigDocToolbar` instead. */
context?: ReactNode;
children: ReactNode;
className?: string;
contentClassName?: string;
};
export function ConfigDocToolbar({
switcher,
actions,
footer,
className,
}: {
switcher: ReactNode;
actions: ReactNode;
/** Live version / read-only hint — rendered as a subtle line under the main row. */
footer?: ReactNode;
className?: string;
}) {
return (
<div className={cn("rounded-lg border border-border/70 bg-background", className)}>
<div className="flex flex-col gap-3 px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
<div className="min-w-0 flex-1">{switcher}</div>
<div className="flex shrink-0 flex-wrap items-center gap-1.5 sm:justify-end">{actions}</div>
</div>
{footer ? (
<div className="border-t border-border/60 px-3 py-2 text-xs text-muted-foreground sm:px-3">{footer}</div>
) : null}
</div>
);
}
export function ConfigDocPage({
title,
titleSuffix,
description,
filters,
toolbar,
context,
children,
className,
contentClassName,
}: ConfigDocPageProps) {
return (
<Card className={className}>
<CardHeader className="border-b border-border/60 pb-4">
<CardTitle className="text-lg">
{title}
{titleSuffix ? (
<span className="ml-2 font-normal text-muted-foreground">{titleSuffix}</span>
) : null}
</CardTitle>
{description ? <CardDescription className="text-base">{description}</CardDescription> : null}
</CardHeader>
<CardContent className={cn("space-y-6 pt-6", contentClassName)}>
{toolbar}
{filters}
{context}
{children}
</CardContent>
</Card>
);
}