fix: convert from use-query-params to nuqs
This commit is contained in:
@@ -4,7 +4,7 @@ import { InboxItemInput } from "./inbox-item-input";
|
||||
import useInterruptedActions from "../hooks/use-interrupted-actions";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { toast } from "sonner";
|
||||
import { useQueryState } from 'nuqs'
|
||||
import { useQueryState } from "nuqs";
|
||||
import { constructOpenInStudioURL } from "../utils";
|
||||
import { HumanInterrupt } from "@langchain/langgraph/prebuilt";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Thread } from "@langchain/langgraph-sdk";
|
||||
import { useEffect } from "react";
|
||||
|
||||
import { getContentString } from "../utils";
|
||||
import { useQueryState, parseAsBoolean } from 'nuqs'
|
||||
import { useQueryState, parseAsBoolean } from "nuqs";
|
||||
import {
|
||||
Sheet,
|
||||
SheetContent,
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
PanelRightClose,
|
||||
SquarePen,
|
||||
} from "lucide-react";
|
||||
import { useQueryState, parseAsBoolean } from 'nuqs'
|
||||
import { useQueryState, parseAsBoolean } from "nuqs";
|
||||
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
||||
import ThreadHistory from "./history";
|
||||
import { toast } from "sonner";
|
||||
|
||||
@@ -11,7 +11,7 @@ import { MessageContentComplex } from "@langchain/core/messages";
|
||||
import { Fragment } from "react/jsx-runtime";
|
||||
import { isAgentInboxInterruptSchema } from "@/lib/agent-inbox-interrupt";
|
||||
import { ThreadView } from "../agent-inbox";
|
||||
import { useQueryState, parseAsBoolean } from 'nuqs'
|
||||
import { useQueryState, parseAsBoolean } from "nuqs";
|
||||
|
||||
function CustomComponent({
|
||||
message,
|
||||
@@ -74,7 +74,8 @@ export function AssistantMessage({
|
||||
handleRegenerate: (parentCheckpoint: Checkpoint | null | undefined) => void;
|
||||
}) {
|
||||
const contentString = getContentString(message.content);
|
||||
const [hideToolCalls] = useQueryState("hideToolCalls",
|
||||
const [hideToolCalls] = useQueryState(
|
||||
"hideToolCalls",
|
||||
parseAsBoolean.withDefault(false),
|
||||
);
|
||||
|
||||
|
||||
@@ -18,4 +18,4 @@ createRoot(document.getElementById("root")!).render(
|
||||
<Toaster />
|
||||
</NuqsAdapter>
|
||||
</BrowserRouter>,
|
||||
);
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
type UIMessage,
|
||||
type RemoveUIMessage,
|
||||
} from "@langchain/langgraph-sdk/react-ui";
|
||||
import { useQueryState } from 'nuqs'
|
||||
import { useQueryState } from "nuqs";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { LangGraphLogoSVG } from "@/components/icons/langgraph";
|
||||
@@ -133,9 +133,7 @@ export const StreamProvider: React.FC<{ children: ReactNode }> = ({
|
||||
_setApiKey(key);
|
||||
};
|
||||
|
||||
const [assistantId, setAssistantId] = useQueryState(
|
||||
"assistantId",
|
||||
);
|
||||
const [assistantId, setAssistantId] = useQueryState("assistantId");
|
||||
|
||||
if (!apiUrl || !assistantId) {
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { validate } from "uuid";
|
||||
import { getApiKey } from "@/lib/api-key";
|
||||
import { Thread } from "@langchain/langgraph-sdk";
|
||||
import { useQueryState } from 'nuqs'
|
||||
import { useQueryState } from "nuqs";
|
||||
import {
|
||||
createContext,
|
||||
useContext,
|
||||
|
||||
Reference in New Issue
Block a user