Add handler when clicking on submit

This commit is contained in:
Tat Dat Duong
2025-03-04 15:50:56 +01:00
parent 9c5b50c2b8
commit 19417a4195

View File

@@ -58,6 +58,8 @@ function StickyToBottomContent(props: {
} }
export function Thread() { export function Thread() {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_, setThreadId] = useQueryParam("threadId", StringParam);
const [input, setInput] = useState(""); const [input, setInput] = useState("");
const [firstTokenReceived, setFirstTokenReceived] = useState(false); const [firstTokenReceived, setFirstTokenReceived] = useState(false);
const stream = useStreamContext(); const stream = useStreamContext();
@@ -136,10 +138,13 @@ export function Thread() {
> >
{chatStarted && ( {chatStarted && (
<div className="flex items-center justify-between gap-3 p-2 pl-4 z-10 relative"> <div className="flex items-center justify-between gap-3 p-2 pl-4 z-10 relative">
<div className="flex gap-2 items-center"> <button
className="flex gap-2 items-center cursor-pointer"
onClick={() => setThreadId(null)}
>
<LangGraphLogoSVG width={32} height={32} /> <LangGraphLogoSVG width={32} height={32} />
<h1 className="text-xl font-medium">LangGraph Chat</h1> <span className="text-xl font-medium">LangGraph Chat</span>
</div> </button>
<NewThread /> <NewThread />