"use client"; import { type ReactNode } from "react"; import { useDashboard } from "@/hooks/use-dashboard"; import { PageHeader, PaperCard, LoadingState, ErrorState, Badge, } from "@/components/ui"; import { NotificationPanel } from "@/components/notification-panel"; import { t } from "@/lib/i18n"; interface StatCardProps { label: string; value: number | string; suffix?: string; } function StatCard({ label, value, suffix }: StatCardProps): ReactNode { return (

{label}

{value} {suffix && ( {suffix} )}

); } export default function DashboardPage(): ReactNode { const { data, loading, error } = useDashboard(); return (
{loading && } {error && } {data && (
{/* 统计卡片 */}
{/* 趋势图(简化的表格) */}

{t("admin.dashboard.trend")}

{data.trend.map((row) => ( ))}
日期 教师 学生 平均分
{row.date} {row.teachers} {row.students} {row.avgScore.toFixed(1)}
{/* 服务健康 */}

{t("admin.dashboard.serviceHealth")}

{data.serviceHealth.map((svc) => (
{svc.serviceName}
{svc.latencyMs}ms
))}
)}
); }