this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wire search route to SearchResults component

Replace the placeholder stub with the fully-implemented SearchResults component.
Adds a mount-time effect to sync the URL ?q= param into the search store so
direct navigation to /cabinet/search?q=foo shows results immediately.

+17 -7
+17 -7
apps/web/src/routes/cabinet/search.lazy.tsx
··· 1 1 import { createLazyFileRoute } from "@tanstack/react-router"; 2 + import { useEffect } from "react"; 3 + import { SearchResults } from "@/components/cabinet/SearchResults"; 4 + import { useSearchStore } from "@/stores/search"; 2 5 3 - function Search() { 4 - return ( 5 - <div className="flex flex-1 items-center justify-center"> 6 - <p className="text-base-content/40 text-sm">Search — not yet wired to SDK</p> 7 - </div> 8 - ); 6 + function SearchPage() { 7 + const { q } = Route.useSearch(); 8 + 9 + // Sync URL param → store on first render so that direct navigation to 10 + // /cabinet/search?q=foo (bookmark, shared link) shows results immediately. 11 + // Subsequent keystrokes are handled by useSearchInput in the TopBar, which 12 + // keeps both the store and the URL in sync. 13 + useEffect(() => { 14 + if (q) useSearchStore.getState().setQuery(q); 15 + // eslint-disable-next-line react-hooks/exhaustive-deps -- intentionally mount-only 16 + }, []); 17 + 18 + return <SearchResults />; 9 19 } 10 20 11 21 export const Route = createLazyFileRoute("/cabinet/search")({ 12 - component: Search, 22 + component: SearchPage, 13 23 });