import { StateView } from "./components/state-view"; import { ThreadActionsView } from "./components/thread-actions-view"; import { useState } from "react"; import { HumanInterrupt } from "@langchain/langgraph/prebuilt"; import { useStreamContext } from "@/providers/Stream"; interface ThreadViewProps { interrupt: HumanInterrupt | HumanInterrupt[]; } export function ThreadView({ interrupt }: ThreadViewProps) { const interruptObj = Array.isArray(interrupt) ? interrupt[0] : interrupt; const thread = useStreamContext(); const [showDescription, setShowDescription] = useState(false); const [showState, setShowState] = useState(false); const showSidePanel = showDescription || showState; const handleShowSidePanel = ( showState: boolean, showDescription: boolean, ) => { if (showState && showDescription) { console.error("Cannot show both state and description"); return; } if (showState) { setShowDescription(false); setShowState(true); } else if (showDescription) { setShowState(false); setShowDescription(true); } else { setShowState(false); setShowDescription(false); } }; return (