mirror of
https://github.com/arthur-pbty/blocnote.git
synced 2026-06-03 23:36:28 +02:00
63e6c64077
- Created a new SVG for the Open Graph image (og-image.svg) with a gradient background and text elements. - Added Vercel logo SVG (vercel.svg) for deployment branding. - Introduced a window icon SVG (window.svg) for UI representation. - Initialized TypeScript configuration file (tsconfig.json) with strict settings and module resolution for a React project.
27 lines
616 B
TypeScript
27 lines
616 B
TypeScript
"use client";
|
|
|
|
import { useMemo } from "react";
|
|
import { marked } from "marked";
|
|
|
|
interface MarkdownPreviewProps {
|
|
content: string;
|
|
}
|
|
|
|
export default function MarkdownPreview({ content }: MarkdownPreviewProps) {
|
|
const html = useMemo(() => {
|
|
if (!content) return '<p class="preview-empty">Commencez à écrire pour voir l\'aperçu...</p>';
|
|
try {
|
|
return marked.parse(content, { breaks: true, gfm: true }) as string;
|
|
} catch {
|
|
return content;
|
|
}
|
|
}, [content]);
|
|
|
|
return (
|
|
<div
|
|
className="markdown-preview prose"
|
|
dangerouslySetInnerHTML={{ __html: html }}
|
|
/>
|
|
);
|
|
}
|