feat(code-editor): refactor layout structure and improve editor height handling

This commit is contained in:
cfngc4594 2025-02-20 00:59:53 +08:00
parent 423951ec58
commit 63501a3f6c

View File

@ -70,16 +70,17 @@ export default function CodeEditor() {
}, []);
return (
<div className="h-screen flex flex-col">
<DynamicEditor
defaultLanguage="c"
defaultValue="# include<stdio.h>"
path="file:///main.c"
theme={
resolvedTheme === "light"
? "github-light-default"
: "github-dark-default"
}
defaultLanguage="c"
defaultValue="# include<stdio.h>"
path="file:///main.c"
height="100%"
options={{ automaticLayout: true }}
beforeMount={(monaco) => {
shikiToMonaco(highlighter, monaco);
}}
@ -88,9 +89,7 @@ export default function CodeEditor() {
console.log("onValidate:", marker.message)
);
}}
options={{ automaticLayout: true }}
loading={<Skeleton className="h-full w-full p-4" />}
/>
</div>
);
}