import type { QuizSections } from "@/lib/quiz-groups";
import { QuizGrid } from "./quiz-grid";
/**
* The "All" tab: Books → book, Lectures & Conversations → year, then the
* stand-alone quizzes. groupQuizzes only returns non-empty groups, and each
* section here renders only when it has groups, so nothing empty shows.
*/
export function GroupedQuizzes({ sections }: { sections: QuizSections }) {
return (
{sections.books.length > 0 && (
{sections.books.map((g) => (
))}
)}
{sections.lectures.length > 0 && (
{sections.lectures.map((g) => (
))}
)}
{sections.other.length > 0 && (
)}
);
}
function Section({
title,
children,
}: {
title: string;
children: React.ReactNode;
}) {
return (
);
}
function Group({
label,
count,
children,
}: {
label: string;
count: number;
children: React.ReactNode;
}) {
return (
{label}
{count}
{children}
);
}