import Game from '@/components/Game'; import { getOrCreateDailyPuzzle } from '@/lib/dailyPuzzle'; import Link from 'next/link'; import { PrismaClient } from '@prisma/client'; export const dynamic = 'force-dynamic'; const prisma = new PrismaClient(); export default async function Home() { const dailyPuzzle = await getOrCreateDailyPuzzle(null); // Global puzzle const genres = await prisma.genre.findMany({ orderBy: { name: 'asc' } }); const specials = await prisma.special.findMany({ orderBy: { name: 'asc' } }); return ( <>
Global {/* Genres */} {genres.map(g => ( {g.name} ))} {/* Separator if both exist */} {genres.length > 0 && specials.length > 0 && ( | )} {/* Specials */} {specials.map(s => ( ★ {s.name} ))}
); }