+
-
@@ -83,6 +99,12 @@ const languageOptions = [
const currentLocale = computed(() => getCurrentLocale());
const switchLanguage = (locale: string) => setLocale(locale);
+function getCountryFlagPngUrl(iso2: string): string {
+ const country = (iso2 ?? "").trim().toLowerCase();
+ if (!/^[a-z]{2}$/.test(country)) return "https://flagcdn.com/w40/un.png";
+ return `https://flagcdn.com/w40/${country}.png`;
+}
+
const selectedCountry = ref(
findCountryCallingCode(
(() => {
@@ -98,10 +120,6 @@ const phone = ref("");
const code = ref("");
const phoneSubmitting = ref(false);
-const selectedCountryDisplay = computed(() => {
- return `${selectedCountry.value.name} (${selectedCountry.value.dialCode})`;
-});
-
const filteredCountries = computed(() => {
const q = countrySearch.value.trim().toLowerCase();
if (!q) {