style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -1,9 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { MessageBubble } from "./MessageBubble";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import type { ChatMessage } from "@/lib/hooks/use-chat";
|
||||
import { MessageBubble } from "./MessageBubble";
|
||||
|
||||
interface MessageListProps {
|
||||
messages: ChatMessage[];
|
||||
@@ -40,7 +40,7 @@ export function MessageList({
|
||||
if (messages.length > 0 && !isLoading) {
|
||||
messagesEndRef.current?.scrollIntoView({ behavior: "auto" });
|
||||
}
|
||||
}, [isLoading]);
|
||||
}, [isLoading, messages.length]);
|
||||
|
||||
// Detectar scroll no topo para carregar mais
|
||||
const handleScroll = () => {
|
||||
@@ -50,7 +50,7 @@ export function MessageList({
|
||||
if (container.scrollTop === 0) {
|
||||
const previousScrollHeight = container.scrollHeight;
|
||||
onLoadMore();
|
||||
|
||||
|
||||
// Ajustar scroll após carregar mais mensagens
|
||||
setTimeout(() => {
|
||||
const newScrollHeight = container.scrollHeight;
|
||||
@@ -75,7 +75,9 @@ export function MessageList({
|
||||
<div className="flex items-center justify-center h-full text-center text-muted-foreground">
|
||||
<div>
|
||||
<p className="text-sm">Nenhuma mensagem ainda</p>
|
||||
<p className="text-xs mt-1">Envie a primeira mensagem para começar a conversa</p>
|
||||
<p className="text-xs mt-1">
|
||||
Envie a primeira mensagem para começar a conversa
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@@ -115,4 +117,3 @@ export function MessageList({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user