From 9c70c66dc59157a58f95c730fc03f24d637936fe Mon Sep 17 00:00:00 2001 From: Leon van Zyl Date: Wed, 13 Aug 2025 11:27:13 +0200 Subject: [PATCH] ui/ markdown support --- src/app/chat/page.tsx | 104 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) diff --git a/src/app/chat/page.tsx b/src/app/chat/page.tsx index 61d1b2d..7d09d67 100644 --- a/src/app/chat/page.tsx +++ b/src/app/chat/page.tsx @@ -5,6 +5,100 @@ import { Button } from "@/components/ui/button"; import { UserProfile } from "@/components/auth/user-profile"; import { useSession } from "@/lib/auth-client"; import { useState, type ReactNode } from "react"; +import ReactMarkdown from "react-markdown"; +import type { Components } from "react-markdown"; +import type { CodeComponent } from "react-markdown/lib/ast-to-react"; + +const H1: React.FC> = (props) => ( +

+); +const H2: React.FC> = (props) => ( +

+); +const H3: React.FC> = (props) => ( +

+); +const Paragraph: React.FC> = ( + props +) =>

; +const UL: React.FC> = (props) => ( +