import { BarChart3, CheckCircle2, ClipboardList, Clock3, FileText, RefreshCw, Server, ShieldCheck, Sparkles, } from "lucide-react"; import { dashboardContent } from "@/app/starter-content"; import { ActivityItem, ChartPanel, DashboardMetricCard, DonutChart, EnvironmentRow, TodoItem, TrendLineChart, type AppTone, type DonutItem, type TrendSeries, } from "@/shared/ui"; type DashboardIconKey = "chart" | "clipboard" | "file" | "refresh" | "shield" | "server"; const metricIcons = { chart: BarChart3, clipboard: ClipboardList, file: FileText, refresh: RefreshCw, server: Server, shield: ShieldCheck, } satisfies Record; const itemIcons = { amber: Clock3, blue: CheckCircle2, emerald: ShieldCheck, rose: Sparkles, slate: Server, violet: ClipboardList, } satisfies Record; export function AdminDashboardPage() { return (
{dashboardContent.metrics.map(metric => { const Icon = metricIcons[(metric.icon as DashboardIconKey) || "chart"] ?? BarChart3; return ( ); })}
近 7 天} title={dashboardContent.trend.title} > ({ ...item })) as TrendSeries[]} /> {dashboardContent.todos.actionText}} title={dashboardContent.todos.title} >
{dashboardContent.todos.items.map(item => { const tone = item.tone as AppTone; const Icon = itemIcons[tone] ?? ClipboardList; return ( } key={item.key} meta={item.meta} time={item.time} title={item.title} tone={tone} /> ); })}
({ color, label, value, })) as DonutItem[]} />
{dashboardContent.aiReview.items.map(item => (
{item.label} {item.value} {item.percent}
))}
{dashboardContent.activities.actionText}} title={dashboardContent.activities.title} >
{dashboardContent.activities.items.map(item => { const tone = item.tone as AppTone; const Icon = itemIcons[tone] ?? Sparkles; return ( } key={item.key} subtitle={item.subtitle} time={item.time} title={item.title} tone={tone} /> ); })}
{dashboardContent.environment.actionText}} title={dashboardContent.environment.title} >
{dashboardContent.environment.rows.map(row => ( ))}
); }