diff --git a/src/components/TopBar.tsx b/src/components/TopBar.tsx new file mode 100644 index 0000000..07847bb --- /dev/null +++ b/src/components/TopBar.tsx @@ -0,0 +1,158 @@ +import { useState, useEffect } from 'react' +import { Home, Search } from 'lucide-react' + +interface TopBarProps { + onSearchClick?: () => void +} + +export function TopBar({ onSearchClick }: TopBarProps) { + const [currentTime, setCurrentTime] = useState(() => formatTime(new Date())) + + useEffect(() => { + const interval = setInterval(() => { + setCurrentTime(formatTime(new Date())) + }, 60_000) + return () => clearInterval(interval) + }, []) + + return ( +
+ {/* Brand */} +
+
+ + {/* Search bar (center) — triggers command palette, no inline search */} + + + {/* Session info (right) */} +
+ + Dr. A.CHARLWOOD + + + Active Session · {currentTime} + +
+
+ ) +} + +function formatTime(date: Date): string { + return date.toLocaleTimeString('en-GB', { + hour: '2-digit', + minute: '2-digit', + hour12: false, + }) +}