mirror of
https://github.com/arthur-pbty/blocnote.git
synced 2026-06-03 23:36:28 +02:00
Add SVG assets and TypeScript configuration
- 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.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"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 }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user