(props: MarkdownRendererProps)
| 6 | } |
| 7 | |
| 8 | function 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 | |
| 33 | export default MarkdownRenderer; |
nothing calls this directly
no test coverage detected