import Game from '@/components/Game'; import { getOrCreateSpecialPuzzle } from '@/lib/dailyPuzzle'; import Link from 'next/link'; import { PrismaClient } from '@prisma/client'; export const dynamic = 'force-dynamic'; const prisma = new PrismaClient(); interface PageProps { params: Promise<{ name: string }>; } export default async function SpecialPage({ params }: PageProps) { const { name } = await params; const decodedName = decodeURIComponent(name); const currentSpecial = await prisma.special.findUnique({ where: { name: decodedName } }); const now = new Date(); const isStarted = currentSpecial && (!currentSpecial.launchDate || currentSpecial.launchDate <= now); const isEnded = currentSpecial && (currentSpecial.endDate && currentSpecial.endDate < now); if (!currentSpecial || !isStarted) { return (
This special has not launched yet or does not exist.
Go HomeThis special event has ended.
Go Home