ae67bff5a3
Self-hosted platform for building, testing, and shipping LangChain/LangGraph agents. Deep-agent sub-agents on the canvas, a live tracing/observability timeline, auto-provisioned built-in tools with import/export, per-environment tool variables, streamed evaluations, and per-user auth token forwarding.
27 lines
978 B
TypeScript
27 lines
978 B
TypeScript
"use client";
|
|
/* Renders an assistant reply as GitHub-Flavored Markdown (Feature 1 - structured responses).
|
|
Safe by default: react-markdown does NOT render raw HTML (no rehype-raw), so agent output
|
|
cannot inject markup. Visual styling lives in the `.md` block in app/globals.css and uses
|
|
the app's design tokens, so it adapts to light/dark automatically. Memoized so finalized
|
|
messages don't re-parse while a newer message is still streaming. */
|
|
import { memo } from "react";
|
|
import ReactMarkdown from "react-markdown";
|
|
import remarkGfm from "remark-gfm";
|
|
|
|
export const Markdown = memo(function Markdown({ children }: { children: string }) {
|
|
return (
|
|
<div className="md">
|
|
<ReactMarkdown
|
|
remarkPlugins={[remarkGfm]}
|
|
components={{
|
|
a: ({ node, ...props }: any) => (
|
|
<a {...props} target="_blank" rel="noopener noreferrer" />
|
|
),
|
|
}}
|
|
>
|
|
{children}
|
|
</ReactMarkdown>
|
|
</div>
|
|
);
|
|
});
|