1- import { Box , Flex , IconButton , TextField } from '@radix-ui/themes'
2- import { ChevronLeftIcon , ChevronRightIcon , MagnifyingGlassIcon , GearIcon } from '@radix-ui/react-icons'
3- import { useNavigationStore } from '@stores/navigationStore'
1+ import {
2+ ChevronLeftIcon ,
3+ ChevronRightIcon ,
4+ GearIcon ,
5+ MagnifyingGlassIcon ,
6+ } from "@radix-ui/react-icons" ;
7+ import { Box , Flex , IconButton , TextField } from "@radix-ui/themes" ;
8+ import { useNavigationStore } from "@stores/navigationStore" ;
49
510interface TopBarProps {
6- onSearchClick ?: ( ) => void
11+ onSearchClick ?: ( ) => void ;
712}
813
914export const TopBar = ( { onSearchClick } : TopBarProps ) => {
10- const { goBack, goForward, canGoBack, canGoForward, toggleSettings } = useNavigationStore ( )
15+ const { goBack, goForward, canGoBack, canGoForward, toggleSettings } =
16+ useNavigationStore ( ) ;
1117
12- return (
13- < Flex className = "w-full h-10 border-b border-gray-6" align = "center" justify = "between" px = "2" gap = "3" >
14- < Flex gap = "1" className = "flex-shrink-0 ml-20" >
15- < IconButton
16- size = "1"
17- variant = "ghost"
18- onClick = { goBack }
19- disabled = { ! canGoBack ( ) }
20- className = { canGoBack ( ) ? 'cursor-pointer' : 'cursor-not-allowed' }
21- >
22- < ChevronLeftIcon />
23- </ IconButton >
24- < IconButton
25- size = "1"
26- variant = "ghost"
27- onClick = { goForward }
28- disabled = { ! canGoForward ( ) }
29- className = { canGoForward ( ) ? 'cursor-pointer' : 'cursor-not-allowed' }
30- >
31- < ChevronRightIcon />
32- </ IconButton >
33- </ Flex >
34- < Box className = "flex-1 max-w-[500px]" >
35- < TextField . Root
36- size = "1"
37- placeholder = "Search..."
38- onClick = { onSearchClick }
39- className = "cursor-pointer"
40- readOnly
41- >
42- < TextField . Slot >
43- < MagnifyingGlassIcon height = "14" width = "14" />
44- </ TextField . Slot >
45- < TextField . Slot >
46- < Box className = "text-xs text-gray-10" > ⌘P</ Box >
47- </ TextField . Slot >
48- </ TextField . Root >
49- </ Box >
50- < Flex gap = "1" >
51- < IconButton
52- size = "1"
53- variant = "ghost"
54- onClick = { toggleSettings }
55- >
56- < GearIcon />
57- </ IconButton >
58- </ Flex >
59- </ Flex >
60- )
61- }
18+ return (
19+ < Flex
20+ className = "h-10 min-h-10 w-full border-gray-6 border-b"
21+ align = "center"
22+ justify = "between"
23+ px = "2"
24+ gap = "3"
25+ >
26+ < Flex gap = "1" className = "ml-20 flex-shrink-0" >
27+ < IconButton
28+ size = "1"
29+ variant = "ghost"
30+ onClick = { goBack }
31+ disabled = { ! canGoBack ( ) }
32+ className = { canGoBack ( ) ? "cursor-pointer" : "cursor-not-allowed" }
33+ >
34+ < ChevronLeftIcon />
35+ </ IconButton >
36+ < IconButton
37+ size = "1"
38+ variant = "ghost"
39+ onClick = { goForward }
40+ disabled = { ! canGoForward ( ) }
41+ className = { canGoForward ( ) ? "cursor-pointer" : "cursor-not-allowed" }
42+ >
43+ < ChevronRightIcon />
44+ </ IconButton >
45+ </ Flex >
46+ < Box className = "max-w-[500px] flex-1" >
47+ < TextField . Root
48+ size = "1"
49+ placeholder = "Search..."
50+ onClick = { onSearchClick }
51+ className = "cursor-pointer"
52+ readOnly
53+ >
54+ < TextField . Slot >
55+ < MagnifyingGlassIcon height = "14" width = "14" />
56+ </ TextField . Slot >
57+ < TextField . Slot >
58+ < Box className = "text-gray-10 text-xs" > ⌘P</ Box >
59+ </ TextField . Slot >
60+ </ TextField . Root >
61+ </ Box >
62+ < Flex gap = "1" >
63+ < IconButton size = "1" variant = "ghost" onClick = { toggleSettings } >
64+ < GearIcon />
65+ </ IconButton >
66+ </ Flex >
67+ </ Flex >
68+ ) ;
69+ } ;
0 commit comments