Files
math-quiz/app/(game)/play/page.tsx
T

17 lines
412 B
TypeScript

import PlayClient from "./PlayClient";
import type { ProblemCount } from "@/store/gameStore";
interface PlayPageProps {
searchParams?: {
count?: string;
};
}
function parseProblemCount(count?: string): ProblemCount {
return count === "5" ? 5 : 10;
}
export default function PlayPage({ searchParams }: PlayPageProps) {
return <PlayClient problemCount={parseProblemCount(searchParams?.count)} />;
}