Use Streamdown (but the css is kinda messed up still)

This commit is contained in:
Alex Gleason committed 2025-08-24 19:37:05 -05:00
1 parent 6c540fc099
commit 61cdc763f8
5 files changed
+53 -4

No files matched your search

+8 -2
View File
@@ -1,4 +1,5 @@
import { memo } from 'react';
import { Streamdown } from 'streamdown';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { Bot, User, Square, Wrench } from 'lucide-react';
import { Button } from '@/components/ui/button';
@@ -67,7 +68,7 @@ export const AIMessageItem = memo(({
})
.join('\n');
}
return message.content || '';
return '';
};
return (
@@ -116,7 +117,12 @@ export const AIMessageItem = memo(({
</div>
<div className="text-sm">
<div className="whitespace-pre-wrap break-words">
{getContent()}
<Streamdown
className='size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0'
parseIncompleteMarkdown={isCurrentlyLoading}
>
{getContent()}
</Streamdown>
</div>
{/* Display tool calls if present */}
+1 -2
View File
@@ -358,7 +358,6 @@ BASE_DOMAIN=nostrdeploy.com`);
key={`${index}-${message.role}-${typeof message.content === 'string' ? message.content.slice(0, 50) : 'content'}`}
message={message}
userDisplayName="You"
isCurrentlyLoading={false}
onStopGeneration={stopGeneration}
/>
))}
@@ -367,7 +366,7 @@ BASE_DOMAIN=nostrdeploy.com`);
key="streaming-message"
message={streamingMessage}
userDisplayName="You"
isCurrentlyLoading={true}
isCurrentlyLoading
onStopGeneration={stopGeneration}
/>
)}