import { marked } from "marked"; import DOMPurify from "dompurify"; import BotIcon from "./icons/BotIcon"; import UserIcon from "./icons/UserIcon"; import "./Chat.css"; import { useEffect } from "react"; function render(text) { return DOMPurify.sanitize(marked.parse(text)); } export default function Chat({ messages }) { const empty = messages.length === 0; useEffect(() => { window.MathJax.typeset(); }, [messages]); return (
{msg.content.length > 0 ? ( ) : ( )}
{msg.content}