presenton/electron/servers/nextjs/components/MarkDownRender.tsx
sudipnext fc1bad2d7c feat: add new image assets and update presentation generation state
- Added new image assets: image_mode.png, logo-with-bg.png, image-provider.png, and openai.png.
- Enhanced presentation generation state to include theme property.
- Introduced updateTheme action in presentation generation slice.
- Updated user configuration with default LLM and image provider settings.
- Modified Tailwind CSS configuration to include new font families.
- Improved API utility functions for better handling of URLs in Electron environment.
- Adjusted PPTX model utility for border radius handling.
- Expanded provider constants to include URLs and icons for LLM providers.
- Updated provider utility functions for consistent API URL usage.
- Added new quality options for image generation providers.
- Updated package-lock.json to include new dependencies for react-colorful and scheduler.
2026-03-20 11:41:50 +05:45

38 lines
No EOL
995 B
TypeScript

"use client";
import React, { useState, useEffect } from "react";
import { marked } from "marked";
import { cn } from "@/lib/utils";
interface MarkdownRendererProps {
content: string;
className?: string;
}
const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, className }) => {
const [markdownContent, setMarkdownContent] = useState<string>("");
useEffect(() => {
const parseMarkdown = async () => {
try {
const parsed = await marked.parse(content);
setMarkdownContent(parsed);
} catch (error) {
console.error("Error parsing markdown:", error);
setMarkdownContent("");
}
};
parseMarkdown();
}, [content]);
return (
<div
className={cn("prose prose-slate max-w-none mb-10", className)}
dangerouslySetInnerHTML={{ __html: markdownContent }}
/>
);
};
export default MarkdownRenderer;