diff --git a/src/app/kid/page.tsx b/src/app/kid/page.tsx index c3c5d44..85e567a 100644 --- a/src/app/kid/page.tsx +++ b/src/app/kid/page.tsx @@ -1,7 +1,10 @@ -import { BookOpen, Flame } from "lucide-react"; +import { BookOpen, Flame, Languages } from "lucide-react"; import Link from "next/link"; import { redirect } from "next/navigation"; +import { and, eq, sql } from "drizzle-orm"; import { BackgroundBlobs } from "@/components/background-blobs"; +import { db } from "@/db"; +import { wordProgress } from "@/db/schema"; import { cn } from "@/lib/utils"; import { SUBJECT_ORDER, subjectMeta } from "@/lib/subjects"; import { todayStr } from "@/lib/dates"; @@ -31,6 +34,13 @@ export default async function KidPage() { const gGoal = gPoints.find((p) => !gPassed.has(p.pointId)); const gDone = gPassed.size; + // 单词入口:已点亮天数 + const [wd] = await db + .select({ n: sql`COUNT(*)` }) + .from(wordProgress) + .where(and(eq(wordProgress.childUserId, user.id), eq(wordProgress.passed, true))); + const wDone = wd.n; + return (
@@ -63,16 +73,20 @@ export default async function KidPage() { -
- -
- 🔤 -
-

单词打卡

-

每天 15 词,发音/详情/跟读/检测

-
+ +
+
+
- +
+

英语单词 · 已点亮 {wDone} 天

+

每天 15 词,发音/跟读/检测

+
+ → +
+ + +
📝