chore: drop unused location search field

This commit is contained in:
Ben Furber
2024-09-11 15:42:28 +01:00
committed by benfurber
parent a1a711ce50
commit b4b49fe722

View File

@@ -1,49 +0,0 @@
import { OsmGeocoding } from 'oa-components'
import { logger } from 'src/logger'
import { getLocationData } from 'src/utils/getLocationData'
import type { FieldProps } from './types'
interface IExtendedFieldProps extends FieldProps {
// add additional onChange style method to respond more directly to value changes
// without need for react-final-form listener
customChange?: (location) => void
}
export const LocationSearchField = ({
input,
customChange,
}: IExtendedFieldProps) => (
<>
<div style={{ position: 'relative', height: '44px' }}>
<div style={{ position: 'absolute', width: '100%' }}>
<OsmGeocoding
callback={async (data) => {
logger.debug(data, 'LocationSearch.field.ReactOsmGeocoding')
if (data.lat && data.lon) {
// onPositionChanged({
// lat: data.lat,
// lng: data.lon,
// })
// setCenter([data.lat, data.lon])
// setZoom(15)
const location = await getLocationData({
lat: data.lat,
lng: data.lon,
})
input.onChange(location)
if (customChange) {
customChange(location)
}
input.onBlur()
}
}}
countrycodes=""
acceptLanguage="en"
/>
</div>
</div>
</>
)