teqo-backup/src/components/campaign/dashboard/useHomeSearchNearestMunicipality.ts
Cursor Agent 7e6bc9d984
B125 — nearest município first in search suggest + wizard
- Restore B117 home search: scopeMunicipalities, merge prefix, session prompt
- Shared useNearestMunicipalitySlug (B14 key) for busca geral + wizard
- Wizard merge uses geoSlug only — no Perto de você / km copy on rows
- Impl plan: docs/plans/municipio-geo-topo-sugestoes-busca-impl.md

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 18:21:52 +00:00

14 lines
523 B
TypeScript

'use client'
import type { AccessibleMunicipality } from '@/lib/municipalityProximity'
import { useNearestMunicipalitySlug } from '@/components/campaign/shared/useNearestMunicipalitySlug'
/**
* B117 / B125 — nearest in-scope município slug for global search suggest.
* Reuses shared prompt + resolve hook (B14 session key).
*/
export const useHomeSearchNearestMunicipality = (
accessible: readonly AccessibleMunicipality[],
enabled: boolean,
): string | null => useNearestMunicipalitySlug(accessible, enabled)