diff --git a/components/forms/CountrySelectField.tsx b/components/forms/CountrySelectField.tsx index f5d1c927..23cbaeee 100644 --- a/components/forms/CountrySelectField.tsx +++ b/components/forms/CountrySelectField.tsx @@ -22,6 +22,15 @@ import { Check, ChevronsUpDown } from 'lucide-react'; import { cn } from '@/lib/utils'; import countryList from 'react-select-country-list'; +const COUNTRY_LABEL_OVERRIDES: Record = { + TW: 'Taiwan', +}; + +const COUNTRY_OPTIONS = countryList().getData().map((country) => ({ + ...country, + label: COUNTRY_LABEL_OVERRIDES[country.value] ?? country.label, +})); + type CountrySelectProps = { name: string; label: string; @@ -39,9 +48,6 @@ const CountrySelect = ({ }) => { const [open, setOpen] = useState(false); - // Get country options with flags - const countries = countryList().getData(); - // Helper function to get flag emoji const getFlagEmoji = (countryCode: string) => { const codePoints = countryCode @@ -63,7 +69,7 @@ const CountrySelect = ({ {value ? ( {getFlagEmoji(value)} - {countries.find((c) => c.value === value)?.label} + {COUNTRY_OPTIONS.find((c) => c.value === value)?.label} ) : ( 'Select your country...' @@ -85,7 +91,7 @@ const CountrySelect = ({ - {countries.map((country) => ( + {COUNTRY_OPTIONS.map((country) => ( ); -}; \ No newline at end of file +};