nandi/oripublic Fork 0
7895c1d1c9bb1048807dc04f7246dc456c47e025
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

Markdown.tsx · 42 lines · 1.1 KBTypeScript Blame HistoryRaw
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago1/**
2 * Markdown renders agent text (GitHub-flavoured: tables, task lists, ...).
3 * Kept as the single markdown entry point so styling and plugins stay
4 * consistent everywhere agent content appears.
5 *
6 * @example
7 * <Markdown text="**bold** and `code`" />
8 */
9
10import ReactMarkdown from "react-markdown";
11import remarkGfm from "remark-gfm";
Add copy-paste functionality for code blocks and completion widgets 7895c1d k33g yesterday12import type { Components } from "react-markdown";
13import { CopyButton } from "./CopyButton";
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago14
15export function Markdown({ text }: { text: string }) {
Add copy-paste functionality for code blocks and completion widgets 7895c1d k33g yesterday16 const components: Components = {
17 pre: ({ children, ...props }) => {
18 // Extract code content from pre > code structure
19 const codeElement = children as React.ReactElement;
20 const codeContent =
21 codeElement?.props?.children &&
22 typeof codeElement.props.children === "string"
23 ? codeElement.props.children
24 : "";
25
26 return (
27 <div className="code-block-wrapper">
28 {codeContent && <CopyButton content={codeContent} label="Copy code" />}
29 <pre {...props}>{children}</pre>
30 </div>
31 );
32 },
33 };
34
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago35 return (
36 <div className="markdown">
Add copy-paste functionality for code blocks and completion widgets 7895c1d k33g yesterday37 <ReactMarkdown remarkPlugins={[remarkGfm]} components={components}>
38 {text}
39 </ReactMarkdown>
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago40 </div>
41 );
42}