mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-19 08:03:06 +00:00
Fold duplicated campanha access, loaders, list/filter/form shells, and scripts into shared modules; reorganize utilities by domain; stabilize e2e; and document prevention-first audit workflow so the same smells cannot creep back in.
21 lines
688 B
TypeScript
21 lines
688 B
TypeScript
import {
|
|
bahiaMunicipalities,
|
|
citiesForTerritory,
|
|
isBahiaIdentityTerritory,
|
|
} from '@/lib/bahiaTerritories'
|
|
|
|
export type StrictComboboxOption = {
|
|
label: string
|
|
value: string
|
|
}
|
|
|
|
const toOptions = (values: readonly string[]): StrictComboboxOption[] =>
|
|
values.map((value) => ({ label: value, value }))
|
|
|
|
/** Full Bahia municipality list — stable module reference for client filters. */
|
|
const allMunicipalityComboboxOptions = toOptions(bahiaMunicipalities)
|
|
|
|
export const municipalityComboboxOptions = (region?: string | null): StrictComboboxOption[] =>
|
|
region && isBahiaIdentityTerritory(region)
|
|
? toOptions(citiesForTerritory(region))
|
|
: allMunicipalityComboboxOptions
|