33 lines
No EOL
757 B
TypeScript
33 lines
No EOL
757 B
TypeScript
// Simulates an API call to a Geocoding service
|
|
export const searchAddress = async (query: string) => {
|
|
await new Promise(resolve => setTimeout(resolve, 600)); // Network delay
|
|
|
|
if (!query) return [];
|
|
|
|
return [
|
|
{
|
|
street: query,
|
|
number: '',
|
|
city: 'São Paulo',
|
|
state: 'SP',
|
|
zip: '01000-000',
|
|
description: `${query}, São Paulo - SP, Brasil`
|
|
},
|
|
{
|
|
street: query,
|
|
number: '',
|
|
city: 'Rio de Janeiro',
|
|
state: 'RJ',
|
|
zip: '20000-000',
|
|
description: `${query}, Rio de Janeiro - RJ, Brasil`
|
|
},
|
|
{
|
|
street: query,
|
|
number: '',
|
|
city: 'Curitiba',
|
|
state: 'PR',
|
|
zip: '80000-000',
|
|
description: `${query}, Curitiba - PR, Brasil`
|
|
}
|
|
];
|
|
}; |