Files
Puechberty Arthur 63e6c64077 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.
2026-03-30 19:25:43 +02:00

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 }}
/>
);
}