-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkdownViewer.jsx
More file actions
25 lines (23 loc) · 839 Bytes
/
MarkdownViewer.jsx
File metadata and controls
25 lines (23 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react';
import * as style from './MarkdownViewer.module.css';
/**
* Lightweight shared markdown viewer component
*
* This component is deliberately lightweight - it only displays pre-processed HTML.
* No markdown libraries are imported here, keeping the bundle size minimal.
*
* Processing happens in the consuming components:
* - Server component: processes markdown server-side (heavy libs stay on server)
* - Client component: processes markdown client-side (heavy libs go to client)
*
* This pattern ensures the viewer itself has minimal bundle impact.
*/
const MarkdownViewer = ({ processedHtml, className }) => {
return (
<div
className={`${style.markdownContent} ${className || ''}`}
dangerouslySetInnerHTML={{ __html: processedHtml }}
/>
);
};
export default MarkdownViewer;