// src/data/countries.ts

import { countries } from "country-data-list";

export const countryList = countries.all
  .map((c) => ({
    name: c.name,
    iso: c.alpha2,
    code: c.countryCallingCodes[0]?.replace(" ", "") || "",
    flag: c.alpha2
      .toUpperCase()
      .replace(
        /./g,
        (char) => String.fromCodePoint(127397 + char.charCodeAt(0))
      ),
  }))
  .filter((c) => c.code);