diff --git a/src/app/(app)/playground/@problem/@submission/page.tsx b/src/app/(app)/playground/@problem/@submission/page.tsx index 79f39bd..8e9b801 100644 --- a/src/app/(app)/playground/@problem/@submission/page.tsx +++ b/src/app/(app)/playground/@problem/@submission/page.tsx @@ -2,14 +2,22 @@ import { useMemo } from 'react'; import MdxPreview from "@/components/mdx-preview"; -import { useCodeEditorState } from "@/store/useCodeEditor"; +import { useCodeEditorStore } from "@/store/useCodeEditorStore"; export default function ProblemSubmissionPage() { - const { result } = useCodeEditorState(); + const { result } = useCodeEditorStore(); + const { exitCode, output, executionTime, memoryUsage } = result || {}; const template = useMemo(() => { - return `\`\`\`bash\n${result || ""}\n\`\`\``; - }, [result]); + return ` + ${exitCode || ""} + \`\`\`bash + ${output || ""} + \`\`\` + ${executionTime || ""} + ${memoryUsage || ""} + `; + }, [exitCode, output, executionTime, memoryUsage]); return ; }