import prisma from "@/lib/prisma"; import { notFound } from "next/navigation"; import ProblemPage from "@/app/(app)/problems/[id]/page"; import { ProblemStoreProvider } from "@/providers/problem-store-provider"; import { PlaygroundHeader } from "@/components/features/playground/header"; interface ProblemProps { params: Promise<{ id: string }>; Description: React.ReactNode; Solutions: React.ReactNode; Submissions: React.ReactNode; Details: React.ReactNode; Code: React.ReactNode; Testcase: React.ReactNode; Bot: React.ReactNode; } export default async function ProblemLayout({ params, Description, Solutions, Submissions, Details, Code, Testcase, Bot, }: ProblemProps) { const { id } = await params; if (!id) { return notFound(); } const [ problem, editorLanguageConfigs, languageServerConfigs, submissions, ] = await Promise.all([ prisma.problem.findUnique({ where: { id }, include: { templates: true, testcases: { include: { data: true, }, }, }, }), prisma.editorLanguageConfig.findMany(), prisma.languageServerConfig.findMany(), prisma.submission.findMany({ where: { problemId: id }, }), ]); if (!problem) { return notFound(); } return (
); }