import { Link } from "waku"; import { getContextData } from "waku/middleware/context"; import { ArrowRightIcon, BookOpenIcon, BrainIcon, LanguagesIcon, GraduationCapIcon } from "lucide-react"; import { Progress } from "@/components/ui/progress"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; import Navbar from "@/components/Navbar"; type LanguageChoice = "th" | "en" | "zh" | "ja" | "es" | "fr"; type LangMeta = { flag: string; name: string; level?: string; progress?: number; totalCards?: number; dueCards?: number }; const langs: Record = { th: { flag: "🇹🇭", name: "Thai", level: "Beginner", progress: 32, totalCards: 245, dueCards: 12 }, en: { flag: "🇬🇧", name: "English", level: "Advanced", progress: 87, totalCards: 542, dueCards: 5 }, zh: { flag: "🇨🇳", name: "Chinese", level: "Intermediate", progress: 59, totalCards: 378, dueCards: 8 }, ja: { flag: "🇯🇵", name: "Japanese", level: "Beginner", progress: 23, totalCards: 198, dueCards: 15 }, es: { flag: "🇪🇸", name: "Spanish", level: "Not Started", progress: 0, totalCards: 312, dueCards: 0 }, fr: { flag: "🇫🇷", name: "French", level: "Not Started", progress: 0, totalCards: 289, dueCards: 0 }, }; export default async function HomePage() { const { user } = getContextData() as any; // Get due cards count for the progress badge const totalDueCards = Object.values(langs) .reduce((sum, lang) => sum + (lang.dueCards || 0), 0); return (
{/* Hero section */}

Master Languages with Sorlang

Boost your language learning with our scientifically proven spaced repetition system. Track progress, analyze text, and learn efficiently.

🇹🇭
🇨🇳
🇯🇵
🇬🇧
SRS
Spaced Repetition System
{/* Feature highlights */}

Learning Features

Tools designed to accelerate your language learning journey

Spaced Repetition Optimized review schedule based on your performance

Our SRS algorithm determines the optimal time for you to review each card, helping you memorize efficiently.

Text Analysis Break down complex text into manageable pieces

Parse any text to analyze grammar, vocabulary, and patterns to enhance your understanding.

Progress Tracking Monitor your learning journey with detailed statistics

Track your progress across different languages, see your mastery level, and identify areas for improvement.

{/* Languages section */}

Your Languages

{totalDueCards > 0 && (
{totalDueCards} cards due for review
)}
{Object.entries(langs).map(([langCode, langData]) => ( ))}
); } export const getConfig = async () => { return { render: "dynamic", } as const; }; function LanguageItem({ lang, langData }: { lang: LanguageChoice, langData: LangMeta }) { return (
{langData.flag}
{langData.name} {langData.level}
{langData.dueCards > 0 && (
{langData.dueCards} due
)}
{langData.progress}% complete {langData.totalCards} cards
); } { /* Language Cards */ } //
// {languages.slice(0, 3).map((lang) => ( //
//
//
//
// {lang.flag} //

{lang.name}

//
// // Beginner // //
//
//
//
//
//
40% Complete
//
// //
//
// ))} //
;