// 练习统计页面 // 依据:02-architecture-design.md §3.1 路由结构 // 路由:/parent/practice "use client"; import { useChildPractice } from "@/hooks/useChildPractice"; import { useChildSwitcher } from "@/hooks/useChildSwitcher"; import { PracticeStatsCard } from "@/components/PracticeStatsCard"; import { PracticeSessionList } from "@/components/PracticeSessionList"; export default function PracticePage() { const { currentChild } = useChildSwitcher(); const { stats, sessions, loading, error } = useChildPractice(); if (loading) { return (
); } if (error) { return (
加载失败:{error.message}
); } const hasData = stats !== null || sessions.length > 0; return (

{currentChild?.name}的练习统计

{!hasData ? (

暂无练习记录

) : ( <> {stats && }

练习历史

)}
); }