Add attribution to Mckay Wrigley

This commit is contained in:
Jared Palmer 2023-07-31 19:21:38 -04:00
parent 1b5811df53
commit 807ad666c2
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,6 @@
// Inspired by Chatbot-UI and modified to fit the needs of this project
// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Chat/ChatMessage.tsx
import { Message } from 'ai'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
@ -28,7 +31,7 @@ export function ChatMessage({ message, ...props }: ChatMessageProps) {
>
{message.role === 'user' ? <IconUser /> : <IconOpenAI />}
</div>
<div className="ml-4 flex-1 space-y-2 overflow-hidden px-1">
<div className="flex-1 px-1 ml-4 space-y-2 overflow-hidden">
<MemoizedReactMarkdown
className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0"
remarkPlugins={[remarkGfm, remarkMath]}
@ -40,7 +43,7 @@ export function ChatMessage({ message, ...props }: ChatMessageProps) {
if (children.length) {
if (children[0] == '▍') {
return (
<span className="mt-1 animate-pulse cursor-default"></span>
<span className="mt-1 cursor-default animate-pulse"></span>
)
}