refactor: Remove animations from Messages and Tool call UI

This commit is contained in:
zaidmukaddam 2024-08-07 19:56:02 +05:30
parent 948c12525e
commit f8747586ab

View File

@ -386,21 +386,9 @@ export default function Home() {
)} )}
</AnimatePresence> </AnimatePresence>
<AnimatePresence> <div className="space-y-4 sm:space-y-6">
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
transition={{ duration: 0.5, delay: 0.1 }}
className="space-y-4 sm:space-y-6"
>
{messages.map((message, index) => ( {messages.map((message, index) => (
<motion.div <div key={index}>
key={index}
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: index * 0.1 }}
>
{message.role === 'assistant' && message.content && ( {message.role === 'assistant' && message.content && (
<Card className="bg-card text-card-foreground border border-muted !mb-8 sm:!mb-16"> <Card className="bg-card text-card-foreground border border-muted !mb-8 sm:!mb-16">
<CardContent className="p-3 sm:p-4"> <CardContent className="p-3 sm:p-4">
@ -416,11 +404,10 @@ export default function Home() {
{renderToolInvocation(toolInvocation, toolIndex)} {renderToolInvocation(toolInvocation, toolIndex)}
</div> </div>
))} ))}
</motion.div> </div>
))} ))}
<div ref={bottomRef} /> <div ref={bottomRef} />
</motion.div> </div>
</AnimatePresence>
</div> </div>
<AnimatePresence> <AnimatePresence>