"use client"; import type { ReactNode } from "react"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; import { HelpCircle } from "lucide-react"; import { Button } from "@/components/ui/button"; function nodeText(value: ReactNode): string { if (typeof value === "string" || typeof value === "number") { return String(value); } if (Array.isArray(value)) { return value.map((item) => nodeText(item)).join(""); } if (value && typeof value === "object" && "props" in value) { return nodeText((value as { props?: { children?: ReactNode } }).props?.children); } return ""; } export function MarkdownContent(props: { content: string; onAskExcerpt?: (excerpt: string) => void; }) { const { content, onAskExcerpt } = props; return (
{children}
{excerpt ? ( ) : null}