This commit is contained in:
Mckay Wrigley
2023-03-18 07:51:17 -06:00
parent 16513b20de
commit 6bf8bacec0
4 changed files with 541 additions and 0 deletions
+2
View File
@@ -1,6 +1,7 @@
import { Message } from "@/types";
import { FC } from "react";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
import { CodeBlock } from "../Markdown/CodeBlock";
interface Props {
@@ -19,6 +20,7 @@ export const ChatMessage: FC<Props> = ({ message, lightMode }) => {
<div className="prose dark:prose-invert mt-[-2px]">
<ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
code({ node, inline, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || "");