8
8
SearchResultList ,
9
9
} from "@/components/ui/search-location" ;
10
10
import { useOpenStreetMapsLocations } from "@/hooks/openstreetmaps" ;
11
+ import { useTranslations } from "@/i18n" ;
11
12
import { cn } from "@/lib/utils" ;
12
13
import { PopoverClose } from "@radix-ui/react-popover" ;
13
14
import { ChevronRightIcon , MapIcon , MapPinIcon , SearchIcon , XIcon } from "lucide-react" ;
@@ -27,6 +28,8 @@ type SearchLocationProps = {
27
28
onOpenChange : ( open : boolean ) => void ;
28
29
} ;
29
30
const SearchLocation = ( { onOpenChange } : SearchLocationProps ) => {
31
+ const t = useTranslations ( ) ;
32
+
30
33
const [ open , setOpen ] = useState ( true ) ;
31
34
const [ locationSearch , setLocationSearch ] = useState ( "" ) ;
32
35
@@ -118,7 +121,6 @@ const SearchLocation = ({ onOpenChange }: SearchLocationProps) => {
118
121
</ PopoverTrigger >
119
122
< PopoverContent
120
123
align = { ! debouncedSearch . length ? "center" : "start" }
121
- // alignOffset={20}
122
124
sideOffset = { 20 }
123
125
side = "left"
124
126
className = { cn (
@@ -133,7 +135,7 @@ const SearchLocation = ({ onOpenChange }: SearchLocationProps) => {
133
135
onChange = { handleSearchChange }
134
136
type = "text"
135
137
value = { locationSearch }
136
- placeholder = "Search"
138
+ placeholder = { t ( "Search" ) }
137
139
className = "w-full border-2 border-background bg-background p-2 px-9 text-sm leading-none text-foreground placeholder:text-sm placeholder:font-light placeholder:text-popover-foreground/50 focus-visible:outline-global"
138
140
/>
139
141
{ locationSearch . length >= 1 && (
@@ -152,7 +154,7 @@ const SearchLocation = ({ onOpenChange }: SearchLocationProps) => {
152
154
</ div >
153
155
154
156
{ ! ! debouncedSearch . length && (
155
- < SearchResultList title = "Locations" >
157
+ < SearchResultList title = { t ( "Locations" ) } >
156
158
{ ! ! locationOptions ?. length ? (
157
159
locationOptions . map ( ( option ) => (
158
160
< SearchResultItem
@@ -172,7 +174,7 @@ const SearchLocation = ({ onOpenChange }: SearchLocationProps) => {
172
174
) }
173
175
174
176
{ ! ! debouncedSearch ?. length && (
175
- < SearchResultList title = "Rangelands stories" >
177
+ < SearchResultList title = { t ( "Rangelands stories" ) } >
176
178
{ storiesOptions ?. length ? (
177
179
storiesOptions . map ( ( option ) => (
178
180
< SearchResultItem
0 commit comments