From 62bdd79b3473262dde5fb0a90eab34fe7bf344fd Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Sun, 17 May 2026 13:07:40 -0700 Subject: 'UI Shell and General Architecture' --- frontend/components/prism/TopBar.tsx | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 frontend/components/prism/TopBar.tsx (limited to 'frontend/components/prism/TopBar.tsx') diff --git a/frontend/components/prism/TopBar.tsx b/frontend/components/prism/TopBar.tsx new file mode 100644 index 0000000..38e8447 --- /dev/null +++ b/frontend/components/prism/TopBar.tsx @@ -0,0 +1,61 @@ +import type { FormEvent } from "react"; +import type { SearchResult } from "@/types/api"; + +type Props = { + query: string; + searching: boolean; + results: SearchResult[]; + marketStatus: { isOpen: boolean; status: string; time: string }; + onChangeQuery: (value: string) => void; + onSubmit: (event: FormEvent) => void; + onSelectTicker: (symbol: string) => void; +}; + +export function TopBar({ query, searching, results, marketStatus, onChangeQuery, onSubmit, onSelectTicker }: Props) { + const showDropdown = query.trim().length >= 2; + + return ( +
+
+
+ + onChangeQuery(event.target.value)} placeholder="Search ticker or company" aria-label="Search ticker" /> + Enter + + + {showDropdown ? ( +
+ {searching ?
Searching...
: null} + {!searching && results.length === 0 ?
No matches
: null} + {!searching + ? results.map((result) => ( + + )) + : null} +
+ ) : null} +
+ +
+
+ + {marketStatus.status} + {marketStatus.time} +
+ +
+ + T + Local Profile +
+
+
+ ); +} + -- cgit v1.3-2-g0d8e