"add delete button functionality"

This commit is contained in:
yenminh269 2025-10-18 21:47:00 -05:00
commit 0f12533873
2 changed files with 8 additions and 3 deletions

View file

@ -24,11 +24,16 @@ export default function ChatLayout() {
}, 600);
}
function handleDeleteAll() {
if (!window.confirm("Delete all messages?")) return;
setMessages([]);
}
return (
<div className="flex flex-col">
<ChatHeader />
<ChatWindow messages={messages} />
<MessageInput onSend={handleSend} />
<MessageInput onSend={handleSend} onDeleteAll={handleDeleteAll} />
</div>
);
}