"use client"; import { motion } from "framer-motion"; import { useState } from "react"; import type { Activity } from "@/lib/schemas"; import { Button } from "@/components/ui"; import { ActivityHeader, FeedbackPanel, Hint, PromptCard, QuestionText, type ActivityComponentProps, } from "./shared"; type FlashcardActivity = Extract; export function Flashcard({ activity, onAnswered, onNext, isLast }: ActivityComponentProps) { const [flipped, setFlipped] = useState(false); const [result, setResult] = useState(null); const settle = (correct: boolean) => { if (result !== null) return; setResult(correct); onAnswered(correct); }; return ( <> {flipped ? "Did you know it before flipping?" : "Tap the card to flip it."} {flipped && result === null ? (
) : null} {result !== null ? ( ) : null} ); }