From db97e26392a16d7b24235ea093bf8bf23aeb497a Mon Sep 17 00:00:00 2001 From: CahidArda Date: Tue, 7 Jan 2025 00:17:53 +0300 Subject: [PATCH] fix: suspense fallback and query param on initial visit --- src/app/page.tsx | 14 +++++++++++--- src/components/search/search-tab.tsx | 7 +++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 563ef92..a70dcee 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -11,7 +11,7 @@ import { } from "@/components/primitive/tabs"; import Container from "@/components/container"; import { BorderBox } from "@/components/border-box"; -import { IconBrandOpenai } from "@tabler/icons-react"; +import { IconBrandOpenai, IconLoader2 } from "@tabler/icons-react"; export default function Page() { const [tab, setTab] = useState<"chat" | "search">("search"); @@ -66,9 +66,17 @@ export default function Page() {
- + + } + > - + {" "} + */
diff --git a/src/components/search/search-tab.tsx b/src/components/search/search-tab.tsx index 81880e0..e64e00d 100644 --- a/src/components/search/search-tab.tsx +++ b/src/components/search/search-tab.tsx @@ -21,16 +21,15 @@ export const SearchTab = () => { if (!isInitial) return; setIsInitial(false); if (searchParam.query) { - console.log("in"); setSearch(searchParam.query); } else { - console.log("out", searchParam); - + const query = "Who are the founders of internet?"; setSearchParam({ - query: "Who are the founders of internet?", + query, leftModel: "MXBAI (Dense)", rightModel: "MXBAI / BM25 (Hybrid)", }); + setSearch(query); } }, [searchParam, isInitial]);