The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | /** |
| 2 | * Syntax-highlighted blob rendering via `@pierre/diffs`' `<File>`. |
| 3 | * |
| 4 | * `React.lazy`-loaded from `Repo.tsx`'s BlobTab so the diffs+shiki |
| 5 | * runtime stays out of the initial bundle. The filename drives language |
| 6 | * detection (by extension); the built-in header is disabled — the tab |
| 7 | * keeps its own lines/bytes bar. |
| 8 | */ |
| 9 | import type { FileContents } from "@pierre/diffs"; |
| 10 | import { File } from "@pierre/diffs/react"; |
| 11 | import { useMemo } from "react"; |
| 12 | import { useFileOptions } from "../diff.tsx"; |
| 13 | |
| 14 | const FileView = ({ name, text }: { name: string; text: string }) => { |
| 15 | const file = useMemo<FileContents>(() => ({ name, contents: text }), [name, text]); |
| 16 | const options = useFileOptions(); |
| 17 | return <File file={file} options={options} />; |
| 18 | }; |
| 19 | |
| 20 | export default FileView; |