/**
 * Canonical Google-Maps link for a restaurant. Prefers the configured
 * place id (lands on the actual business listing, like a shared maps
 * short-link) and falls back to an address search.
 */
export function buildMapsUrl(googlePlaceId?: string, address?: string): string | undefined {
	if (googlePlaceId) {
		return `https://www.google.com/maps/search/?api=1&query=Google&query_place_id=${encodeURIComponent(googlePlaceId)}`
	}
	if (address) {
		return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`
	}
	return undefined
}
