"making the delete button works"

This commit is contained in:
yenminh269 2025-10-19 08:22:59 -05:00
commit d1cddf2690
2 changed files with 4 additions and 4 deletions

View file

@ -31,9 +31,9 @@ export default function ChatLayout() {
return (
<div className="flex flex-col flex-start w-full max-w-3xl gap-4 p-4">
<ChatHeader />
<ChatHeader onDeleteAll={handleDeleteAll} />
<ChatWindow messages={messages} />
<MessageInput onSend={handleSend} onDeleteAll={handleDeleteAll}/>
<MessageInput onSend={handleSend} />
</div>
);
}

View file

@ -4,7 +4,7 @@ import { Rocket } from "lucide-react";
import DeleteButton from "src/components/ui/button/delete-button";
import SchematicButton from "../button/schematic-button";
export default function ChatHeader({ title = "Title of Chat" }) {
export default function ChatHeader({ title = "Title of Chat", onDeleteAll }) {
const isDebug = useMemo(() => {
const p = new URLSearchParams(window.location.search);
return p.get("debug") === "1";
@ -36,7 +36,7 @@ export default function ChatHeader({ title = "Title of Chat" }) {
<h1 className="text-lg font-semibold shadow-md shadow-indigo-600 bg-gray-900 px-6 py-2 rounded-4xl border-2 border-gray-800">
{title}
</h1>
<DeleteButton />
<DeleteButton onClick={onDeleteAll} />
{isDebug && (
<motion.button
onClick={triggerDemoIngest}