@@ -4,7 +4,9 @@ import { useState, useRef, useImperativeHandle, forwardRef, useEffect } from "re
44 import PaperPlaneIcon from "@/src/components/icons/PaperPlaneIcon";
55 import PrimaryButton from "@/src/components/buttons/PrimaryButton";
66 import ThinkingNotification from "@/src/components/ThinkingNotification";
7+import DeleteThreadButton from "@/src/components/DeleteThreadButton";
78 import type { Message } from "@/src/lib/db/schema";
9+import type { Thread } from "@/src/lib/db/schema";
810
911 type MessageInputProps = {
1012 isLoading: boolean;
@@ -14,6 +16,9 @@ type MessageInputProps = {
1416 modelName?: string;
1517 isStreaming?: boolean;
1618 onStop?: () => void;
19+ currentThreadId: number | null;
20+ currentThread: Thread | null;
21+ onThreadDelete?: (threadId: number) => void;
1722 };
1823
1924 export type MessageInputRef = {
@@ -30,6 +35,9 @@ const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
3035 modelName = "gpt-oss",
3136 isStreaming = false,
3237 onStop,
38+ currentThreadId,
39+ currentThread,
40+ onThreadDelete,
3341 },
3442 ref
3543 ) => {
@@ -129,7 +137,20 @@ const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
129137 return (
130138 <div className="pointer-events-none absolute bottom-0 left-0 right-0 z-10 flex justify-center p-1">
131139 <div className="pointer-events-auto m-4 w-full max-w-5xl">
132- {isStreaming && onStop && <ThinkingNotification onStop={onStop} />}
140+ <div className="mb-2 flex items-start justify-between gap-2">
141+ <div className="flex-1">
142+ {isStreaming && onStop && <ThinkingNotification onStop={onStop} />}
143+ </div>
144+ {currentThreadId !== null && currentThread && onThreadDelete && (
145+ <div className="flex-shrink-0">
146+ <DeleteThreadButton
147+ threadId={currentThreadId}
148+ threadTitle={currentThread.title || `Thread ${currentThreadId}`}
149+ onDeleteThread={onThreadDelete}
150+ />
151+ </div>
152+ )}
153+ </div>
133154 <form
134155 onSubmit={handleSubmit}
135156 className="relative rounded-lg bg-neutral-300 shadow-lg dark:bg-neutral-700"