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(); return notFound();
} }
const { templates, ...problemWithoutTemplates } = problemData;
return ( return (
<div className="h-screen flex flex-col"> <div className="h-screen flex flex-col">
<ProblemStoreProvider <ProblemStoreProvider
problemId={id} problemId={id}
problem={problemData} problem={problemWithoutTemplates}
templates={problemData.templates ?? []} templates={templates}
editorLanguageConfigs={editorLanguageConfigs} editorLanguageConfigs={editorLanguageConfigs}
languageServerConfigs={languageServerConfigs} languageServerConfigs={languageServerConfigs}
> >