MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / MarkdownRenderer

Function MarkdownRenderer

src/components/MarkdownRenderer.tsx:8–31  ·  view source on GitHub ↗
(props: MarkdownRendererProps)

Source from the content-addressed store, hash-verified

6}
7
8function MarkdownRenderer(props: MarkdownRendererProps) {
9 const [markdown, setMarkdown] = useState<string>("");
10
11 useEffect(() => {
12 const fetchData = async () => {
13 const response = await fetch(props.url);
14 const data = await response.text();
15 setMarkdown(data);
16 };
17 fetchData();
18 }, [props.url]);
19
20 return (
21 <ReactMarkdown
22 className="w-auto max-w-full px-4 py-2 prose prose-neutral"
23 components={{
24 p: ({ children }) => <p style={{ color: "black" }}>{children}</p>,
25 li: ({ children }) => <li style={{ color: "black" }}>{children}</li>,
26 }}
27 >
28 {markdown}
29 </ReactMarkdown>
30 );
31}
32
33export default MarkdownRenderer;

Callers

nothing calls this directly

Calls 1

fetchDataFunction · 0.85

Tested by

no test coverage detected