refactor(PlaygroundLayout): separate templates from problemData

This commit is contained in:
cfngc4594 2025-03-24 10:39:56 +08:00
parent d0118eca65
commit 45cbbc2978

View File

@ -40,12 +40,14 @@ export default async function PlaygroundLayout({
return notFound();
}
const { templates, ...problemWithoutTemplates } = problemData;
return (
<div className="h-screen flex flex-col">
<ProblemStoreProvider
problemId={id}
problem={problemData}
templates={problemData.templates ?? []}
problem={problemWithoutTemplates}
templates={templates}
editorLanguageConfigs={editorLanguageConfigs}
languageServerConfigs={languageServerConfigs}
>