mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Use Streamdown (but the css is kinda messed up still)
This commit is contained in:
5 files changed
+53
-4
No files matched your search
@@ -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 */}
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user