mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 08:00:06 +00:00
feat(maps): show where an Amap hit came from, and keep its id
An Amap row now carries the same source mark the TREK index, OpenStreetMap and Google rows get, named per locale because 高德地图 is the name it goes by where it matters. The "search is on OpenStreetMap" notices and the key hint in the details column are gone with the keys dev had already removed, and the client-side provider mirror with them. amap_poi_id travels with a picked result into the form, the details column and the shadow log, so a saved place keeps the id it was found by. A pasted Amap link goes to the resolver like a Google one.
This commit is contained in:
@@ -474,49 +474,12 @@ describe('PlaceDetailsColumn — hours and rating', () => {
|
||||
* same thing in the shape every other empty state in TREK uses, and whose key is
|
||||
* missing is not this panel's business.
|
||||
*/
|
||||
describe('PlaceDetailsColumn — no key behind place search', () => {
|
||||
const empty = () => placeEnrichment.mockResolvedValue({ photos: [], facts: [], description: null })
|
||||
describe('PlaceDetailsColumn — nothing found', () => {
|
||||
it('FE-PDC-027: shows the empty state once, and no advice about API keys', async () => {
|
||||
placeEnrichment.mockResolvedValue({ photos: [], facts: [], description: null })
|
||||
renderColumn()
|
||||
|
||||
it('FE-PDC-027: suggests a key when nothing was found and none is set', async () => {
|
||||
empty()
|
||||
renderColumn({ keySuggestion: 'google' })
|
||||
|
||||
expect(await screen.findByText('places.details.noKeyTitle')).toBeInTheDocument()
|
||||
expect(screen.getByText('places.details.noKeyHint')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-PDC-027b: suggests the Amap key when that is the one the admin chose', async () => {
|
||||
// An install on Amap is not "missing a Google key" — the hint has to name
|
||||
// the key that would actually move search off OpenStreetMap.
|
||||
empty()
|
||||
renderColumn({ keySuggestion: 'amap' })
|
||||
|
||||
expect(await screen.findByText('places.details.noKeyTitle')).toBeInTheDocument()
|
||||
expect(screen.getByText('places.details.noKeyHintAmap')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-PDC-027c: names both keys when the choice is automatic and neither is set', async () => {
|
||||
empty()
|
||||
renderColumn({ keySuggestion: 'any' })
|
||||
|
||||
expect(await screen.findByText('places.details.noKeyTitle')).toBeInTheDocument()
|
||||
expect(screen.getByText('places.details.noKeyHintAny')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-PDC-027d: stays quiet when OpenStreetMap was chosen on purpose', async () => {
|
||||
// The null suggestion: an explicit admin decision, not a gap to fill.
|
||||
empty()
|
||||
renderColumn({ keySuggestion: null })
|
||||
|
||||
await screen.findByText('places.details.nothing')
|
||||
expect(screen.queryByText('places.details.noKeyTitle')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-PDC-028: stays quiet when a key is already configured', async () => {
|
||||
empty()
|
||||
renderColumn({ keySuggestion: null })
|
||||
|
||||
await screen.findByText('places.details.nothing')
|
||||
expect(await screen.findByText('places.details.nothing')).toBeInTheDocument()
|
||||
expect(screen.queryByText('places.details.noKeyTitle')).not.toBeInTheDocument()
|
||||
expect(screen.queryByText('places.details.noKeyHint')).not.toBeInTheDocument()
|
||||
})
|
||||
@@ -527,7 +490,7 @@ describe('PlaceDetailsColumn — no key behind place search', () => {
|
||||
facts: [],
|
||||
description: { text: 'Ein Museum.', source: 'wikipedia', sourceUrl: null, license: 'CC BY-SA 4.0' },
|
||||
})
|
||||
renderColumn({ keySuggestion: 'google' })
|
||||
renderColumn()
|
||||
|
||||
await screen.findByText('Ein Museum.')
|
||||
expect(screen.queryByText('places.details.nothing')).not.toBeInTheDocument()
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
Loader2,
|
||||
ScrollText,
|
||||
ShoppingBag,
|
||||
Sparkles,
|
||||
Sprout,
|
||||
Star,
|
||||
Sun,
|
||||
@@ -27,19 +26,8 @@ import { resolveOpenNow, resolvePlaceTimeZone, placeWeekdayIndex } from './place
|
||||
import { convertHoursLine, isUnknownHoursLine, splitHoursLine } from './placeHoursFormat'
|
||||
import { safeHttpUrl } from '../../utils/safeUrl'
|
||||
import EmptyState from '../shared/EmptyState'
|
||||
import type { KeySuggestion } from '../../utils/placesProvider'
|
||||
import type { TranslationFn } from '../../types'
|
||||
|
||||
/**
|
||||
* The "add a key" hint line, per which key would move search off OpenStreetMap.
|
||||
* The Google variant reuses the long-standing key every locale already carries.
|
||||
*/
|
||||
const NO_KEY_HINT_KEY: Record<Exclude<KeySuggestion, never>, string> = {
|
||||
google: 'places.details.noKeyHint',
|
||||
amap: 'places.details.noKeyHintAmap',
|
||||
any: 'places.details.noKeyHintAny',
|
||||
}
|
||||
|
||||
/** The place the column is describing. Null while nothing is selected. */
|
||||
export interface PlaceDetailsSelection {
|
||||
placeId?: string
|
||||
@@ -63,12 +51,7 @@ interface PlaceDetailsColumnProps {
|
||||
timeFormat?: string
|
||||
/** For grouping the rating count's digits. */
|
||||
locale?: string
|
||||
/**
|
||||
* Which API key the "more detail available" hint should suggest, or null when
|
||||
* there is nothing to suggest — a configured provider answers, or the admin
|
||||
* chose OpenStreetMap on purpose and the hint would be a nag.
|
||||
*/
|
||||
keySuggestion?: KeySuggestion | null
|
||||
/** False on an instance with no Google key, which is most of them. */
|
||||
t: TranslationFn
|
||||
}
|
||||
|
||||
@@ -134,7 +117,6 @@ export default function PlaceDetailsColumn({
|
||||
language,
|
||||
timeFormat = '24h',
|
||||
locale = 'en-US',
|
||||
keySuggestion = null,
|
||||
t,
|
||||
}: PlaceDetailsColumnProps): React.ReactElement {
|
||||
const [data, setData] = useState<MapsPlaceEnrichmentResult | null>(null)
|
||||
@@ -254,20 +236,14 @@ export default function PlaceDetailsColumn({
|
||||
plainly; whose key is missing is not this panel's business, and on a
|
||||
place the free sources describe fine it read as an advert. */}
|
||||
{isEmpty && (
|
||||
<div className="space-y-2">
|
||||
<EmptyState
|
||||
scene="search"
|
||||
mood="sad"
|
||||
title={t('places.details.nothing')}
|
||||
size={92}
|
||||
fill
|
||||
surface="var(--bg-secondary)"
|
||||
/>
|
||||
{/* Only when both are true. With a key behind the search there is
|
||||
nothing to suggest, and on a place the free sources DID describe
|
||||
the suggestion would be an advert. */}
|
||||
{keySuggestion && <NoKeyHint t={t} suggestion={keySuggestion} />}
|
||||
</div>
|
||||
<EmptyState
|
||||
scene="search"
|
||||
mood="sad"
|
||||
title={t('places.details.nothing')}
|
||||
size={92}
|
||||
fill
|
||||
surface="var(--bg-secondary)"
|
||||
/>
|
||||
)}
|
||||
|
||||
{selection && state === 'ready' && !data?.disabled && !isEmpty && (
|
||||
@@ -496,19 +472,6 @@ function PhotoCredit({ photo }: { photo: PlacePhotoCandidate }): React.ReactElem
|
||||
* It also names who to ask: the key is an instance-wide setting, so on most
|
||||
* installs the person reading this cannot act on it themselves.
|
||||
*/
|
||||
function NoKeyHint({ t, suggestion }: { t: TranslationFn; suggestion: KeySuggestion }): React.ReactElement {
|
||||
return (
|
||||
<div className="rounded-xl border border-accent/25 bg-accent-subtle p-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-accent text-accent-text">
|
||||
<Sparkles className="h-3 w-3" />
|
||||
</span>
|
||||
<p className="text-caption font-semibold text-content">{t('places.details.noKeyTitle')}</p>
|
||||
</div>
|
||||
<p className="mt-2 text-caption leading-relaxed text-content-secondary">{t(NO_KEY_HINT_KEY[suggestion])}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* The star rating, as stars.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { isGoogleMapsUrl } from './PlaceFormModal.helpers'
|
||||
import { isAmapUrl, isGoogleMapsUrl, isMapUrl } from './PlaceFormModal.helpers'
|
||||
|
||||
describe('isGoogleMapsUrl', () => {
|
||||
it('accepts the short share hosts', () => {
|
||||
@@ -39,3 +39,25 @@ describe('isGoogleMapsUrl', () => {
|
||||
expect(isGoogleMapsUrl(' https://maps.app.goo.gl/abc123 ')).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('isAmapUrl', () => {
|
||||
it('accepts the share, web and short-link hosts', () => {
|
||||
expect(isAmapUrl('https://uri.amap.com/marker?position=116.397,39.908&name=天安门')).toBe(true)
|
||||
expect(isAmapUrl('https://www.amap.com/place/B000A7BD6C')).toBe(true)
|
||||
expect(isAmapUrl('https://surl.amap.com/abc')).toBe(true)
|
||||
})
|
||||
|
||||
it('is an exact host list, so a lookalike stays a search query', () => {
|
||||
expect(isAmapUrl('https://amap.com.evil.example/place/x')).toBe(false)
|
||||
expect(isAmapUrl('https://restapi.amap.com/v3/place/text')).toBe(false)
|
||||
expect(isAmapUrl('天安门')).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('isMapUrl', () => {
|
||||
it('sends either provider\'s link to the resolver and nothing else', () => {
|
||||
expect(isMapUrl('https://maps.app.goo.gl/abc123')).toBe(true)
|
||||
expect(isMapUrl('https://uri.amap.com/marker?position=116.397,39.908')).toBe(true)
|
||||
expect(isMapUrl('https://example.com/maps')).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -17,6 +17,7 @@ export interface PlaceFormData {
|
||||
google_place_id?: string
|
||||
google_ftid?: string
|
||||
osm_id?: string
|
||||
amap_poi_id?: string
|
||||
// Hero image picked from the detail column. Optional and absent from
|
||||
// DEFAULT_FORM on purpose: the mobile sheet shares this type and never sets
|
||||
// it, and places.service already writes image_url through on create/update.
|
||||
@@ -55,6 +56,26 @@ export function isGoogleMapsUrl(input: string): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Amap's own hosts, the same set the server resolves (amap.provider.ts). An
|
||||
* exact list rather than a shape: Amap has no ccTLD family, so a pattern would
|
||||
* only widen what the search box hands to the resolver.
|
||||
*/
|
||||
const AMAP_HOSTS = new Set(['amap.com', 'www.amap.com', 'uri.amap.com', 'wb.amap.com', 'surl.amap.com', 'gaode.com', 'www.gaode.com'])
|
||||
|
||||
export function isAmapUrl(input: string): boolean {
|
||||
try {
|
||||
return AMAP_HOSTS.has(new URL(input.trim()).hostname.toLowerCase())
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/** A pasted link the server can turn into a place, from either provider. */
|
||||
export function isMapUrl(input: string): boolean {
|
||||
return isGoogleMapsUrl(input) || isAmapUrl(input)
|
||||
}
|
||||
|
||||
export const DEFAULT_FORM: PlaceFormData = {
|
||||
name: '',
|
||||
description: '',
|
||||
@@ -81,6 +102,7 @@ export const RESULT_FIELDS = [
|
||||
'google_place_id',
|
||||
'google_ftid',
|
||||
'osm_id',
|
||||
'amap_poi_id',
|
||||
'website',
|
||||
'phone',
|
||||
] as const
|
||||
|
||||
@@ -462,33 +462,34 @@ describe('PlaceFormModal', () => {
|
||||
expect(await screen.findByText('OpenStreetMap')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
// The notice says what is actually true per provider choice, not "add a
|
||||
// Google key" on an install whose admin picked Amap. See utils/placesProvider.
|
||||
describe('FE-PLANNER-PLACEFORM-022b: the OSM notice follows the provider choice', () => {
|
||||
it('suggests the Amap key when the admin chose Amap and none is set', () => {
|
||||
seedStore(useAuthStore, { user: buildUser(), isAuthenticated: true, hasMapsKey: false, hasAmapKey: false, placesProvider: 'amap' });
|
||||
render(<PlaceFormModal {...defaultProps} />);
|
||||
expect(screen.getByText(/高德|Amap/i)).toBeInTheDocument();
|
||||
});
|
||||
it('FE-PLANNER-PLACEFORM-022d: an Amap list marks its rows, and a pick keeps the Amap id', async () => {
|
||||
// Amap answers from the slot Google otherwise holds, so its rows get the
|
||||
// same mark the other sources get. The id travels with the place: it is
|
||||
// what lets the saved place keep opening against Amap after the admin
|
||||
// switches providers.
|
||||
const user = userEvent.setup();
|
||||
const onSave = vi.fn();
|
||||
server.use(
|
||||
http.post('/api/maps/search', () =>
|
||||
HttpResponse.json({
|
||||
places: [
|
||||
{ name: '天安门', address: '北京市东城区', lat: '39.9087', lng: '116.3975', amap_poi_id: 'amap:B000A7BD6C', source: 'amap' },
|
||||
],
|
||||
source: 'amap',
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
it('stays quiet when the chosen provider has its key', () => {
|
||||
seedStore(useAuthStore, { user: buildUser(), isAuthenticated: true, hasMapsKey: false, hasAmapKey: true, placesProvider: 'amap' });
|
||||
render(<PlaceFormModal {...defaultProps} />);
|
||||
expect(screen.queryByText(/OpenStreetMap/i)).not.toBeInTheDocument();
|
||||
});
|
||||
render(<PlaceFormModal {...defaultProps} onSave={onSave} />);
|
||||
await user.type(screen.getByPlaceholderText('Search places...'), 'Tiananmen');
|
||||
await user.keyboard('{Enter}');
|
||||
|
||||
it('stays quiet when the admin explicitly chose OpenStreetMap', () => {
|
||||
seedStore(useAuthStore, { user: buildUser(), isAuthenticated: true, hasMapsKey: false, hasAmapKey: false, placesProvider: 'openstreetmap' });
|
||||
render(<PlaceFormModal {...defaultProps} />);
|
||||
// A deliberate choice is not a gap to fill — no upsell line at all.
|
||||
expect(screen.queryByText(/OpenStreetMap/i)).not.toBeInTheDocument();
|
||||
});
|
||||
expect(await screen.findByText('Amap')).toBeInTheDocument();
|
||||
await user.click(screen.getByText('天安门'));
|
||||
await user.click(screen.getByRole('button', { name: /^Add$/i }));
|
||||
|
||||
it('stays quiet under auto when a Google key is configured', () => {
|
||||
seedStore(useAuthStore, { user: buildUser(), isAuthenticated: true, hasMapsKey: true, hasAmapKey: true, placesProvider: 'auto' });
|
||||
render(<PlaceFormModal {...defaultProps} />);
|
||||
expect(screen.queryByText(/OpenStreetMap/i)).not.toBeInTheDocument();
|
||||
});
|
||||
await waitFor(() => expect(onSave).toHaveBeenCalled());
|
||||
expect(onSave.mock.calls[0][0].amap_poi_id).toBe('amap:B000A7BD6C');
|
||||
});
|
||||
|
||||
// ── Category ─────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -7,18 +7,6 @@ import { mapsApi } from '../../api/client'
|
||||
import { recordPlacePick } from '../../api/placeShadow'
|
||||
import { useAuthStore } from '../../store/authStore'
|
||||
import { useAddonStore } from '../../store/addonStore'
|
||||
import { effectivePlacesProvider, osmKeySuggestion, type KeySuggestion } from '../../utils/placesProvider'
|
||||
|
||||
/**
|
||||
* The "search is on OpenStreetMap" line, per which key would actually move it
|
||||
* off. The Google variant reuses the long-standing key, which every locale
|
||||
* already carries; the other two are new with Amap.
|
||||
*/
|
||||
const OSM_ACTIVE_KEY: Record<KeySuggestion, string> = {
|
||||
google: 'places.osmActive',
|
||||
amap: 'places.osmActiveAmap',
|
||||
any: 'places.osmActiveAny',
|
||||
}
|
||||
import { useCanDo } from '../../store/permissionsStore'
|
||||
import { useTripStore } from '../../store/tripStore'
|
||||
import { useSettingsStore } from '../../store/settingsStore'
|
||||
@@ -28,7 +16,7 @@ import { useToast } from '../shared/Toast'
|
||||
import { Search, Paperclip, X, AlertTriangle, Loader2, Plus } from 'lucide-react'
|
||||
import { useTranslation } from '../../i18n'
|
||||
import CustomTimePicker from '../shared/CustomTimePicker'
|
||||
import { DEFAULT_FORM, isGoogleMapsUrl, mergeResult, type PlaceFormData, type ResultField } from './PlaceFormModal.helpers'
|
||||
import { DEFAULT_FORM, isMapUrl, mergeResult, type PlaceFormData, type ResultField } from './PlaceFormModal.helpers'
|
||||
import { getApiErrorMessage } from '../../utils/apiError'
|
||||
import { sourceLabelFor } from '../../utils/placeSource'
|
||||
import { useLocationBias } from '../../hooks/useLocationBias'
|
||||
@@ -170,11 +158,7 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
const placesSessionRef = useRef(new PlacesSession())
|
||||
const toast = useToast()
|
||||
const { t, language, locale } = useTranslation()
|
||||
const { hasMapsKey, hasAmapKey, placesProvider, placesEnrichEnabled } = useAuthStore()
|
||||
// What the search notices say depends on what will actually answer: an
|
||||
// install whose admin picked Amap is not "missing a Google key".
|
||||
const searchProvider = effectivePlacesProvider({ placesProvider, hasMapsKey, hasAmapKey })
|
||||
const keySuggestion = osmKeySuggestion(placesProvider)
|
||||
const { hasMapsKey, placesEnrichEnabled } = useAuthStore()
|
||||
const can = useCanDo()
|
||||
const timeFormat = useSettingsStore((s) => s.settings.time_format) || '24h'
|
||||
const tripObj = useTripStore((s) => s.trip)
|
||||
@@ -251,7 +235,7 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
// because only handleSelectMapsResult ever set it.
|
||||
if (place && place.lat != null && place.lng != null) {
|
||||
setDetailsSelection({
|
||||
placeId: place.google_place_id || place.osm_id || undefined,
|
||||
placeId: place.google_place_id || place.amap_poi_id || place.osm_id || undefined,
|
||||
lat: Number(place.lat),
|
||||
lng: Number(place.lng),
|
||||
name: place.name || '',
|
||||
@@ -290,7 +274,7 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
|
||||
// Autocomplete fetch — aborts any in-flight request before starting a new one
|
||||
const fetchSuggestions = useCallback(async (query: string) => {
|
||||
if (query.length < 2 || isGoogleMapsUrl(query)) {
|
||||
if (query.length < 2 || isMapUrl(query)) {
|
||||
setAcSuggestions([])
|
||||
setAcHighlight(-1)
|
||||
return
|
||||
@@ -317,7 +301,7 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
if (acDebounceRef.current) clearTimeout(acDebounceRef.current)
|
||||
|
||||
const trimmed = mapsSearch.trim()
|
||||
if (trimmed.length < 2 || isGoogleMapsUrl(trimmed)) {
|
||||
if (trimmed.length < 2 || isMapUrl(trimmed)) {
|
||||
setAcSuggestions([])
|
||||
setAcHighlight(-1)
|
||||
placesSessionRef.current.end()
|
||||
@@ -341,9 +325,9 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
if (!mapsSearch.trim()) return
|
||||
setIsSearchingMaps(true)
|
||||
try {
|
||||
// Detect Google Maps URLs and resolve them directly
|
||||
// A pasted Google Maps or Amap link resolves server-side into a place
|
||||
const trimmed = mapsSearch.trim()
|
||||
if (isGoogleMapsUrl(trimmed)) {
|
||||
if (isMapUrl(trimmed)) {
|
||||
const resolved = await mapsApi.resolveUrl(trimmed)
|
||||
if (resolved.lat && resolved.lng) {
|
||||
setForm(prev => ({
|
||||
@@ -385,7 +369,7 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
const lng = Number(result.lng)
|
||||
if (Number.isFinite(lat) && Number.isFinite(lng)) {
|
||||
setDetailsSelection({
|
||||
placeId: result.google_place_id || result.osm_id || undefined,
|
||||
placeId: result.google_place_id || result.amap_poi_id || result.osm_id || undefined,
|
||||
lat,
|
||||
lng,
|
||||
name: result.name || '',
|
||||
@@ -411,7 +395,7 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
pickedName: result.name || '',
|
||||
pickedLat: lat,
|
||||
pickedLng: lng,
|
||||
pickedPlaceId: result.google_place_id || result.osm_id || null,
|
||||
pickedPlaceId: result.google_place_id || result.amap_poi_id || result.osm_id || null,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -663,8 +647,7 @@ function usePlaceFormModal(props: PlaceFormModalProps) {
|
||||
language,
|
||||
locale,
|
||||
timeFormat,
|
||||
searchProvider,
|
||||
keySuggestion,
|
||||
hasMapsKey,
|
||||
placesEnrichEnabled,
|
||||
can,
|
||||
tripObj,
|
||||
@@ -736,8 +719,7 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
|
||||
toast,
|
||||
t,
|
||||
language,
|
||||
searchProvider,
|
||||
keySuggestion,
|
||||
hasMapsKey,
|
||||
placesEnrichEnabled,
|
||||
can,
|
||||
tripObj,
|
||||
@@ -811,21 +793,12 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
|
||||
language={language}
|
||||
timeFormat={S.timeFormat}
|
||||
locale={S.locale}
|
||||
// Null when search genuinely has no key behind it — the column then
|
||||
// explains which one would help, or stays quiet when OpenStreetMap
|
||||
// was chosen on purpose.
|
||||
keySuggestion={searchProvider === 'openstreetmap' ? keySuggestion : null}
|
||||
t={t}
|
||||
/>
|
||||
)}
|
||||
<form onSubmit={handleSubmit} className={twoColumn || showDetails ? 'flex-1 min-w-0 space-y-3' : 'space-y-3'} onPaste={handlePaste}>
|
||||
{/* Place Search */}
|
||||
<div className="bg-surface-secondary rounded-xl p-3 border border-edge">
|
||||
{searchProvider === 'openstreetmap' && keySuggestion && (
|
||||
<p className="mb-2 text-xs text-content-faint">
|
||||
{t(OSM_ACTIVE_KEY[keySuggestion])}
|
||||
</p>
|
||||
)}
|
||||
<div className="relative">
|
||||
<div className="flex gap-2">
|
||||
<input
|
||||
@@ -873,7 +846,7 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
|
||||
<div className="text-xs text-content-muted truncate">{s.secondaryText}</div>
|
||||
)}
|
||||
</div>
|
||||
<SourceBadge label={sourceLabelFor(s, acSource)} />
|
||||
<SourceBadge label={sourceLabelFor(s, acSource, t)} />
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
@@ -896,7 +869,7 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
|
||||
<div className="font-medium text-sm truncate">{result.name}</div>
|
||||
<div className="text-xs text-content-muted truncate">{result.address}</div>
|
||||
</div>
|
||||
<SourceBadge label={sourceLabelFor(result, searchSource)} />
|
||||
<SourceBadge label={sourceLabelFor(result, searchSource, t)} />
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user