"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 ( return (
<div className="flex flex-col flex-start w-full max-w-3xl gap-4 p-4"> <div className="flex flex-col flex-start w-full max-w-3xl gap-4 p-4">
<ChatHeader /> <ChatHeader onDeleteAll={handleDeleteAll} />
<ChatWindow messages={messages} /> <ChatWindow messages={messages} />
<MessageInput onSend={handleSend} onDeleteAll={handleDeleteAll}/> <MessageInput onSend={handleSend} />
</div> </div>
); );
} }

View file

@ -4,7 +4,7 @@ import { Rocket } from "lucide-react";
import DeleteButton from "src/components/ui/button/delete-button"; import DeleteButton from "src/components/ui/button/delete-button";
import SchematicButton from "../button/schematic-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 isDebug = useMemo(() => {
const p = new URLSearchParams(window.location.search); const p = new URLSearchParams(window.location.search);
return p.get("debug") === "1"; 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"> <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} {title}
</h1> </h1>
<DeleteButton /> <DeleteButton onClick={onDeleteAll} />
{isDebug && ( {isDebug && (
<motion.button <motion.button
onClick={triggerDemoIngest} onClick={triggerDemoIngest}