mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(playground): add submission page for displaying code execution results
This commit is contained in:
parent
164eb3f0f5
commit
10a0c7ab99
15
src/app/(app)/playground/@problem/@submission/page.tsx
Normal file
15
src/app/(app)/playground/@problem/@submission/page.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo } from 'react';
|
||||
import MdxPreview from "@/components/mdx-preview";
|
||||
import { useCodeEditorState } from "@/store/useCodeEditor";
|
||||
|
||||
export default function ProblemSubmissionPage() {
|
||||
const { result } = useCodeEditorState();
|
||||
|
||||
const template = useMemo(() => {
|
||||
return `\`\`\`bash\n${result || ""}\`\`\``;
|
||||
}, [result]);
|
||||
|
||||
return <MdxPreview source={template} />;
|
||||
}
|
Loading…
Reference in New Issue
Block a user