"use client"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; import type { Components } from "react-markdown"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; type ProjectIntroDialogProps = { title: string; intro?: string; }; const markdownComponents: Components = { a: ({ href, children }) => ( {children} ), img: ({ src, alt }) => ( {alt ), table: ({ children }) => (
{children}
), th: ({ children }) => ( {children} ), td: ({ children }) => ( {children} ) }; /** 可选的项目介绍:shadcn Button 打开 Dialog,正文按 Markdown 渲染 */ export const ProjectIntroDialog = ({ title, intro = "" }: ProjectIntroDialogProps) => { const body = intro.trim() || "暂无介绍"; return ( } > Intro {title} {title} 项目介绍
{body}
); };