import { useState } from 'react'; export type Country = { code: string; name: string; name_en: string }; export default function CountrySelect({ countries, value, onChange, id, disabled = false }: { countries: Country[]; value: string; onChange: (value: string) => void; id: string; disabled?: boolean; }) { const [search, setSearch] = useState(''); const matches = countries.filter((country) => country.code === value || `${country.name} ${country.name_en} ${country.code}`.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase() .includes(search.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase())); return
Nenhum país corresponde à pesquisa.
}