import prisma from "@/lib/prisma"; import { notFound } from "next/navigation"; import { ProblemStoreProvider } from "@/providers/problem-store-provider"; import { PlaygroundHeader } from "@/components/features/playground/header"; interface ProblemProps { params: Promise<{ id: string }>; children: React.ReactNode; } export default async function ProblemLayout({ params, children, }: ProblemProps) { const { id } = await params; const [problemData, editorLanguageConfigs, languageServerConfigs] = await Promise.all([ prisma.problem.findUnique({ where: { id }, include: { templates: true }, }), prisma.editorLanguageConfig.findMany(), prisma.languageServerConfig.findMany(), ]); if (!problemData) { return notFound(); } const { templates, ...problemWithoutTemplates } = problemData; return (
{children}
); }