mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +00:00
feat(editor): update loading state with padding and refactor dynamic import
This commit is contained in:
parent
0c1ecbcff2
commit
d89a45daa8
@ -11,6 +11,7 @@ import { connectToLanguageServer } from "@/lib/language-server";
|
||||
import { LanguageServerMetadata } from "@/types/language-server";
|
||||
import type { MonacoLanguageClient } from "monaco-languageclient";
|
||||
|
||||
// Dynamically import Monaco Editor with SSR disabled
|
||||
const Editor = dynamic(
|
||||
async () => {
|
||||
await import("vscode");
|
||||
@ -21,7 +22,11 @@ const Editor = dynamic(
|
||||
},
|
||||
{
|
||||
ssr: false,
|
||||
loading: () => <Skeleton className="h-full w-full rounded-3xl" />
|
||||
loading: () => (
|
||||
<div className="h-full w-full p-2">
|
||||
<Skeleton className="h-full w-full rounded-3xl" />
|
||||
</div>
|
||||
),
|
||||
}
|
||||
);
|
||||
|
||||
@ -112,7 +117,11 @@ export default function CoreEditorLsp({
|
||||
beforeMount={handleEditorWillMount}
|
||||
onMount={handleEditorDidMount}
|
||||
options={editorConfig}
|
||||
loading={<Skeleton className="h-full w-full rounded-3xl" />}
|
||||
loading={
|
||||
<div className="h-full w-full p-2">
|
||||
<Skeleton className="h-full w-full rounded-3xl" />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user