nandi/oripublic Fork 0
ca7e020cbb6442f047e0002eb9831ba29f8a17af
Commits
Clone
git clone https://git.rickub.com/nandi/ori.git
git clone ssh://git@rickub.com/nandi/ori.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

forked from bots-garden/ori

CodeView.tsx · 22 lines · 551 BTypeScript Blame HistoryRaw
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday1/**
2 * CodeView shows read-only source code with Monaco's syntax highlighting,
3 * lazy-loading Monaco on first use.
4 *
5 * @example
6 * <CodeView content="package main" language="go" />
7 */
8
9import { lazy, Suspense } from "react";
10
11const MonacoViewer = lazy(() => import("./MonacoViewer"));
12
13export function CodeView({
14 content,
15 language,
16}: { content: string; language: string }) {
17 return (
18 <Suspense fallback={<p className="pane-empty">loading viewer</p>}>
19 <MonacoViewer content={content} language={language} readOnly />
20 </Suspense>
21 );
22}