Files
edueasy/app/francesca/page.tsx
T
renato97 a3360ec6e4 feat: fase 2+3 — expansion masiva multi-perfil + bug fixes + hardening
Fase 2 (expansion):
- Francesca: +6 etapas matematicas (5-10), +7 etapas lectura (3-9), +2 ortografia
- Sebastian: +8 etapas matematicas (4-11), +6 lectura, +3 historia, +3 geografia, +1 banderas
- Nuevas paginas: ortografia, lectura, geografia, matematicas
- ~900 ejercicios nuevos, paridad ~500 por perfil

Fase 3 (bug fixes + hardening):
- Fix: SessionLog auto-create en grade route
- Fix: engine cache (no borrar antes de revisar)
- Fix: FSRS cards actualizadas en flujo curriculum
- Fix: responseMs real (no hardcodeado 3000)
- Fix: options dentro de content en sebastian etapa-1
- Fix: trazo-letra consonantes crash
- Security: execFileSync anti-command-injection en TTS
- DB: 18 cascade deletes + indices + unique constraints
- APIs debug: reset, state, seed
- Docker: espeak-ng + prisma + user/group
- E2E: 23 tests nuevos (curriculum-flow.spec.ts)
- Code review: tailwind colors, middleware dev mode, eslint config

Verificado: tsc exit 0, build exit 0, 61 E2E tests pass
2026-07-25 22:07:28 -03:00

77 lines
2.8 KiB
TypeScript

"use client"
import { useEffect, useState } from "react"
import { useRouter } from "next/navigation"
import { GatoMascota } from "@/components/child/gato-mascota"
import AudioUnlock from "@/components/child/audio-unlock"
const FRANCESCA_KEY = "edueasy_child_francesca"
const activities = [
{ id: "matematicas", label: "Matemáticas", icon: "🔢", description: "Sumas, restas, tablas y divisiones" },
{ id: "lecturas", label: "Lecturas cortas", icon: "📖", description: "Leé textos sobre distintos temas" },
{ id: "ortografia", label: "Ortografía", icon: "✏️", description: "Mayúsculas y reglas" },
{ id: "logros", label: "Mis logros", icon: "⭐", color: "bg-warning" },
{ id: "pairing", label: "iPad nuevo", icon: "🔗", color: "bg-secondary" },
]
export default function FrancescaHome() {
const router = useRouter()
const [audioReady, setAudioReady] = useState(false)
const [paired, setPaired] = useState(false)
useEffect(() => {
setPaired(!!localStorage.getItem(FRANCESCA_KEY))
}, [])
const handleActivity = (id: string) => {
if (id === "logros") {
router.push("/child/logros?profile=francesca")
} else if (id === "pairing") {
router.push("/child/pairing?profile=francesca")
} else {
router.push(`/francesca/${id}`)
}
}
if (!audioReady) {
return <AudioUnlock onUnlock={() => setAudioReady(true)} />
}
return (
<div className="flex-1 flex flex-col items-center justify-center p-6 gap-8">
<GatoMascota mood="happy" message="¡Hola Francesca! ¿Qué querés practicar hoy?" />
{!paired ? (
<div className="text-center max-w-xs space-y-4">
<p className="text-foreground/60">Todavía no estás conectada. Pedile a mamá que te empareje.</p>
<button
onClick={() => router.push("/child/pairing?profile=francesca")}
className="bg-primary text-primary-foreground touch-target-lg rounded-2xl px-8 py-4 text-xl font-display font-bold"
>
Ir a emparejar
</button>
</div>
) : (
<div className="flex flex-col gap-4 w-full max-w-md">
{activities.map((a) => (
<button
key={a.id}
onClick={() => handleActivity(a.id)}
className={`${a.color || "bg-accent"} text-primary-foreground touch-target-lg rounded-2xl flex items-center gap-4 px-6 py-5 text-xl font-display font-semibold shadow-md active:scale-95 transition-transform`}
>
<span className="text-2xl">{a.icon}</span>
<div className="text-left">
<div>{a.label}</div>
{a.description && (
<div className="text-sm opacity-80">{a.description}</div>
)}
</div>
</button>
))}
</div>
)}
</div>
)
}