Add markdown

This commit is contained in:
Nicolas Mowen
2026-02-12 19:19:22 -07:00
parent 79d7d20866
commit a21cabae2d
4 changed files with 1168 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import { FaArrowUpLong } from "react-icons/fa6";
import { useTranslation } from "react-i18next";
import { useState, useCallback } from "react";
import axios from "axios";
import ReactMarkdown from "react-markdown";
type ChatMessage = { role: "user" | "assistant"; content: string };
@@ -57,7 +58,11 @@ export default function ChatPage() {
: "self-start rounded-lg bg-muted px-3 py-2"
}
>
{msg.content}
{msg.role === "assistant" ? (
<ReactMarkdown>{msg.content}</ReactMarkdown>
) : (
msg.content
)}
</div>
))}
{isLoading && (