"use client"; /** One quiz in the /quizzes list: what it's on, its title, and your progress. */ import Link from "next/link"; import { ClipboardCheck } from "lucide-react"; import { quizActionLabel, type QuizCard } from "@/lib/quiz"; import { cn } from "@/lib/utils"; const KIND: Record = { chapter: "Book chapter", lecture: "Lecture", conversation: "Conversation", standalone: "Quiz", }; export function QuizListCard({ q }: { q: QuizCard }) { const done = q.my.state === "completed"; return (

{KIND[q.target_kind]}

{q.title}

{q.target_title && (

{q.target_title}

)}
{q.question_count} {q.question_count === 1 ? "question" : "questions"} {quizActionLabel(q.my.state)} {done && q.my.score !== undefined && ` ยท ${q.my.score}/${q.my.total}`}
); }