mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(code-editor): update default value for code editor based on language
This commit is contained in:
parent
5d99032be9
commit
d3d27768fb
@ -5,6 +5,7 @@ import dynamic from "next/dynamic";
|
||||
import { useTheme } from "next-themes";
|
||||
import normalizeUrl from "normalize-url";
|
||||
import { highlighter } from "@/lib/shiki";
|
||||
import { DEFAULT_VALUE } from "@/config/value";
|
||||
import { shikiToMonaco } from "@shikijs/monaco";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { useCodeEditorState } from "@/store/useCodeEditor";
|
||||
@ -76,7 +77,7 @@ export default function CodeEditor() {
|
||||
return (
|
||||
<DynamicEditor
|
||||
defaultLanguage={language}
|
||||
defaultValue="# include<stdio.h>"
|
||||
defaultValue={DEFAULT_VALUE[language]}
|
||||
path="file:///main.c"
|
||||
theme={resolvedTheme === "light" ? "github-light-default" : "github-dark-default"}
|
||||
height="100%"
|
||||
|
Loading…
Reference in New Issue
Block a user