import { useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { motion } from 'framer-motion'; import { useSettings } from '../stores/settingsStore.js'; import { useSession } from '../stores/sessionStore.js'; const sizeOptions: (number | 'all')[] = [10, 20, 30, 50, 'all']; const directions: { value: 'forward' | 'backward' | 'both'; label: string; hint: string }[] = [ { value: 'forward', label: 'Vraag → antwoord', hint: 'Standaard' }, { value: 'backward', label: 'Antwoord → vraag', hint: 'Voor bidirectionele lessen' }, { value: 'both', label: 'Beide richtingen', hint: 'Dubbele oefening' }, ]; export function PracticeSetupPage() { const { lessonId } = useParams(); const id = Number(lessonId); const defaultMax = useSettings((s) => s.defaultMaxCards); const start = useSession((s) => s.start); const navigate = useNavigate(); const [maxCards, setMaxCards] = useState(defaultMax); const [shuffle, setShuffle] = useState(true); const [direction, setDirection] = useState<'forward' | 'backward' | 'both'>('forward'); const [busy, setBusy] = useState(false); async function begin() { setBusy(true); await start({ lessonId: id, maxCards: maxCards === 'all' ? null : maxCards, shuffle, direction }); navigate(`/practice/${id}`); } return (

Klaar om te oefenen?

Configureer je sessie en begin.

{sizeOptions.map((n) => ( setMaxCards(n)} > {n === 'all' ? 'Alle' : n} ))}
{directions.map((d) => ( ))}
); } function Section({ title, children }: { title: string; children: React.ReactNode }) { return (
{title}
{children}
); } function Pill({ active, onClick, children }: { active: boolean; onClick: () => void; children: React.ReactNode }) { return ( ); }