import { getContextData } from "waku/middleware/context"; import { useState } from "react"; import { getState } from "@/lib/db"; import { startStudySession } from "@/actions/srs"; import StudySession from "@/components/Flashcard/StudySession"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; // This is a server component that gets the initial data export default async function StudyPage({ searchParams, }: { searchParams: { lessonId?: string }; }) { const { user } = getContextData() as any; // const state = getState(null); const userId = user?.id; // If not logged in, show login required message if (!userId) { return (
You need to be logged in to use the study session feature.
Here are some example lesson IDs you can use: