diff --git a/webui/frontend/package.json b/webui/frontend/package.json index 9e2339d..da864dd 100644 --- a/webui/frontend/package.json +++ b/webui/frontend/package.json @@ -9,24 +9,24 @@ "lint": "next lint" }, "dependencies": { - "@nextui-org/react": "^2.2.10", - "framer-motion": "^11.0.25", + "@nextui-org/react": "^2.4.2", + "framer-motion": "^11.2.14", "next": "14.1.4", - "react": "^18", - "react-dom": "^18", + "react": "^18.3.1", + "react-dom": "^18.3.1", "react-icons": "^5.2.1", "react-query": "^3.39.3", "zod": "^3.23.8" }, "devDependencies": { - "@types/node": "^20", - "@types/react": "^18", - "@types/react-dom": "^18", + "@types/node": "^20.14.10", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", "autoprefixer": "^10.4.19", - "eslint": "^8", + "eslint": "^8.57.0", "eslint-config-next": "14.1.4", - "postcss": "^8.4.38", - "tailwindcss": "^3.4.3", - "typescript": "^5" + "postcss": "^8.4.39", + "tailwindcss": "^3.4.4", + "typescript": "^5.5.3" } } diff --git a/webui/frontend/src/app/components/Header.tsx b/webui/frontend/src/app/components/Header.tsx index 96529ad..068674c 100644 --- a/webui/frontend/src/app/components/Header.tsx +++ b/webui/frontend/src/app/components/Header.tsx @@ -13,8 +13,10 @@ import { usePathname } from "next/navigation"; const Header = () => { const pathName = usePathname(); + const isSticky = pathName === "/" ? "sticky" : "static"; + return ( - +

Research Chain diff --git a/webui/frontend/src/app/components/PromptInput.tsx b/webui/frontend/src/app/components/PromptInput.tsx index c1c883f..d4dfaf5 100644 --- a/webui/frontend/src/app/components/PromptInput.tsx +++ b/webui/frontend/src/app/components/PromptInput.tsx @@ -1,5 +1,6 @@ "use client"; -import React, { Key, useState } from "react"; +import React, { Key, useState, useContext } from "react"; +import { SummarizerContext } from "@/app/context/SummarizerContext"; import { Button, Tab, Tabs, Textarea } from "@nextui-org/react"; import { UseMutationOptions, @@ -14,8 +15,7 @@ type FormValues = { }; type MutationResult = { - success: boolean; - message: string; + uuid: string; }; function PromptInput() { @@ -24,6 +24,7 @@ function PromptInput() { prompt: "", mode: "", }); + const context = useContext(SummarizerContext); const FormData = z.object({ prompt: z.string().min(1), @@ -83,7 +84,9 @@ function PromptInput() { return result; }, { - onSuccess: (result) => {}, + onSuccess: (result) => { + context?.sendUuid(result.uuid); + }, onError: (error) => {}, } as UseMutationOptions ); @@ -103,7 +106,7 @@ function PromptInput() { })); }; - const handleSubmit = (event: React.FormEvent) => { + const handleSubmit = async (event: React.FormEvent) => { event.preventDefault(); if (crawlActive) { addCrawl.mutate(formValues); @@ -113,54 +116,52 @@ function PromptInput() { }; return ( -
-
-