nandi/oripublic⑂ Fork 0⑂ 00224b167266e7d496672adfe1e60fcffeab7e63
Commits⬇ Clone ▾
forked from bots-garden/ori
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/**
* CodeView shows read-only source code with Monaco's syntax highlighting,
* lazy-loading Monaco on first use.
*
* @example
* <CodeView content="package main" language="go" />
*/
import { lazy, Suspense } from "react";
const MonacoViewer = lazy(() => import("./MonacoViewer"));
export function CodeView({
content,
language,
}: { content: string; language: string }) {
return (
<Suspense fallback={<p className="pane-empty">loading viewer…</p>}>
<MonacoViewer content={content} language={language} readOnly />
</Suspense>
);
}
|