nandi/oripublic Fork 0
00224b167266e7d496672adfe1e60fcffeab7e63
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

InlineText.tsx · 27 lines · 684 BTypeScript Blame HistoryRaw
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday1/**
2 * InlineText renders a one-line string in which `backtick` spans become
3 * monospace <code> elements — for tool call titles, permission titles and
4 * plan entries, where full markdown would be overkill but agents routinely
5 * quote commands and paths.
6 *
7 * @example
8 * <InlineText text="Run `ls .memory/`" />
9 */
10
11export function InlineText({ text }: { text: string }) {
12 // Even segments are plain text, odd segments were between backticks.
13 const parts = text.split("`");
14 return (
15 <>
16 {parts.map((part, index) =>
17 index % 2 === 1 ? (
18 <code key={`${index}:${part}`} className="inline-code">
19 {part}
20 </code>
21 ) : (
22 part
23 ),
24 )}
25 </>
26 );
27}