forked from codechefPesuecc/CodeChef-PESUECC-Chapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeEditor.tsx
More file actions
26 lines (23 loc) · 774 Bytes
/
Copy pathCodeEditor.tsx
File metadata and controls
26 lines (23 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"use client";
import dynamic from "next/dynamic";
import type { LanguageId } from "./mockData";
import type { IntegrityEvent } from "./useIntegrityMonitor";
// CodeMirror relies on browser APIs, so load it client-side only.
const CodeMirrorEditor = dynamic(() => import("./CodeMirrorEditor"), {
ssr: false,
loading: () => (
<div className="flex h-[460px] items-center justify-center bg-[var(--ide-body)] font-mono text-sm text-[var(--ide-ink-dim)]">
Loading editor…
</div>
),
});
export default function CodeEditor(props: {
value: string;
onChange: (value: string) => void;
language: LanguageId;
lockClipboard?: boolean;
onBlocked?: (event: IntegrityEvent) => void;
fullscreen?: boolean;
}) {
return <CodeMirrorEditor {...props} />;
}