diff --git a/src/app/(app)/problems/[id]/@workspace/@editor/layout.tsx b/src/app/(app)/problems/[id]/@workspace/@editor/layout.tsx index abbe23c..f2f3f35 100644 --- a/src/app/(app)/problems/[id]/@workspace/@editor/layout.tsx +++ b/src/app/(app)/problems/[id]/@workspace/@editor/layout.tsx @@ -1,16 +1,35 @@ +import prisma from "@/lib/prisma"; import WorkspaceEditorHeader from "@/features/playground/workspace/editor/header"; import WorkspaceEditorFooter from "@/features/playground/workspace/editor/footer"; interface WorkspaceEditorLayoutProps { + params: Promise<{ id: string }>; children: React.ReactNode; } -export default function WorkspaceEditorLayout({ +export default async function WorkspaceEditorLayout({ + params, children, }: WorkspaceEditorLayoutProps) { + const { id } = await params; + + const problem = await prisma.problem.findUnique({ + where: { id: parseInt(id) }, + select: { + templates: { + select: { + language: true, + template: true, + } + } + } + }); + + const templates = problem?.templates ?? []; + return (
- +
{children}