export type CurrencyOption = {
  code: string
  name: string
  symbol: string
}

export const currencyOptions: CurrencyOption[] = [
  {name: "Afghan Afghani", symbol: "؋‎", code: "AFN"},
  {name: "Albanian Lek", symbol: "Lek", code: "ALL"},
  {name: "Algerian Dinar", symbol: "DA", code: "DZD"},
  {name: "Angolan Kwanza", symbol: "Kz", code: "AOA"},
  {name: "Argentine Peso", symbol: "$", code: "ARS"},
  {name: "Armenian Dram", symbol: "֏", code: "AMD"},
  {name: "Aruban Florin", symbol: "ƒ", code: "AWG"},
  {name: "Australian Dollar", symbol: "$", code: "AUD"},
  {name: "Azerbaijani Manat", symbol: "₼", code: "AZN"},
  {name: "Bahamian Dollar", symbol: "$", code: "BSD"},
  {name: "Bahraini Dinar", symbol: "BD", code: "BHD"},
  {name: "Bangladeshi Taka", symbol: "৳", code: "BDT"},
  {name: "Barbadian Dollar", symbol: "$", code: "BBD"},
  {name: "Belarusian Ruble", symbol: "Br", code: "BYN"},
  {name: "Belize Dollar", symbol: "$", code: "BZD"},
  {name: "Bermudian Dollar", symbol: "$", code: "BMD"},
  {name: "Bhutanese Ngultrum", symbol: "Nu", code: "BTN"},
  {name: "Satoshi", symbol: "!", code: "SAT"},
  {name: "Bitcoin", symbol: "₿", code: "BTC"},
  {name: "Bolivian Boliviano", symbol: "Bs", code: "BOB"},
  {name: "Bosnia And Herzegovina Convertible Mark", symbol: "KM", code: "BAM"},
  {name: "Botswana Pula", symbol: "P", code: "BWP"},
  {name: "Brazilian Real", symbol: "R$", code: "BRL"},
  {name: "Brunei Dollar", symbol: "$", code: "BND"},
  {name: "Bulgarian Lev", symbol: "Lev", code: "BGN"},
  {name: "Burmese Kyat", symbol: "K", code: "MMK"},
  {name: "Burundian Franc", symbol: "Fr", code: "BIF"},
  {name: "CFP Franc", symbol: "Fr", code: "XPF"},
  {name: "Cambodian Riel", symbol: "៛", code: "KHR"},
  {name: "Canadian Dollar", symbol: "$", code: "CAD"},
  {name: "Cape Verdean Escudo", symbol: "$", code: "CVE"},
  {name: "Cayman Islands Dollar", symbol: "$", code: "KYD"},
  {name: "Central African CFA Franc", symbol: "Fr", code: "XAF"},
  {name: "Chilean Peso", symbol: "$", code: "CLP"},
  {name: "Colombian Peso", symbol: "$", code: "COP"},
  {name: "Comorian Franc", symbol: "Fr", code: "KMF"},
  {name: "Congolese Franc", symbol: "Fr", code: "CDF"},
  {name: "Costa Rican Colón", symbol: "₡", code: "CRC"},
  {name: "Cuban Peso", symbol: "$", code: "CUP"},
  {name: "Czech Koruna", symbol: "Kč", code: "CZK"},
  {name: "Danish Krone", symbol: "kr", code: "DKK"},
  {name: "Djiboutian Franc", symbol: "Fr", code: "DJF"},
  {name: "Dominican Peso", symbol: "$", code: "DOP"},
  {name: "Eastern Caribbean Dollar", symbol: "$", code: "XCD"},
  {name: "Egyptian Pound", symbol: "LE", code: "EGP"},
  {name: "Eritrean Nakfa", symbol: "Nkf", code: "ERN"},
  {name: "Ethiopian Birr", symbol: "Br", code: "ETB"},
  {name: "Euro", symbol: "€", code: "EUR"},
  {name: "Falkland Islands Pound", symbol: "£", code: "FKP"},
  {name: "Fijian Dollar", symbol: "$", code: "FJD"},
  {name: "Gambian Dalasi", symbol: "D", code: "GMD"},
  {name: "Georgian Lari", symbol: "₾", code: "GEL"},
  {name: "Ghanaian Cedi", symbol: "₵", code: "GHS"},
  {name: "Gibraltar Pound", symbol: "£", code: "GIP"},
  {name: "Guatemalan Quetzal", symbol: "Q", code: "GTQ"},
  {name: "Guinean Franc", symbol: "Fr", code: "GNF"},
  {name: "Guyanese Dollar", symbol: "$", code: "GYD"},
  {name: "Haitian Gourde", symbol: "G", code: "HTG"},
  {name: "Honduran Lempira", symbol: "L", code: "HNL"},
  {name: "Hong Kong Dollar", symbol: "$", code: "HKD"},
  {name: "Hungarian Forint", symbol: "Ft", code: "HUF"},
  {name: "Icelandic Króna", symbol: "kr", code: "ISK"},
  {name: "Indian Rupee", symbol: "₹", code: "INR"},
  {name: "Indonesian Rupiah", symbol: "Rp", code: "IDR"},
  {name: "Iranian Rial", symbol: "Rl", code: "IRR"},
  {name: "Iraqi Dinar", symbol: "ID", code: "IQD"},
  {name: "Israeli New Shekel", symbol: "₪", code: "ILS"},
  {name: "Jamaican Dollar", symbol: "$", code: "JMD"},
  {name: "Japanese Yen", symbol: "¥", code: "JPY"},
  {name: "Jordanian Dinar", symbol: "JD", code: "JOD"},
  {name: "Kazakhstani Tenge", symbol: "₸", code: "KZT"},
  {name: "Kenyan Shilling", symbol: "Sh", code: "KES"},
  {name: "Kuwaiti Dinar", symbol: "KD", code: "KWD"},
  {name: "Kyrgyz Som", symbol: "som", code: "KGS"},
  {name: "Lao Kip", symbol: "₭", code: "LAK"},
  {name: "Lebanese Pound", symbol: "LL", code: "LBP"},
  {name: "Lesotho Loti", symbol: "L", code: "LSL"},
  {name: "Liberian Dollar", symbol: "$", code: "LRD"},
  {name: "Libyan Dinar", symbol: "LD", code: "LYD"},
  {name: "Macanese Pataca", symbol: "MOP$", code: "MOP"},
  {name: "Macedonian Denar", symbol: "DEN", code: "MKD"},
  {name: "Malagasy Ariary", symbol: "Ar", code: "MGA"},
  {name: "Malawian Kwacha", symbol: "K", code: "MWK"},
  {name: "Malaysian Ringgit", symbol: "RM", code: "MYR"},
  {name: "Maldivian Rufiyaa", symbol: "Rf", code: "MVR"},
  {name: "Mauritanian Ouguiya", symbol: "UM", code: "MRU"},
  {name: "Mauritian Rupee", symbol: "Re", code: "MUR"},
  {name: "Mexican Peso", symbol: "$", code: "MXN"},
  {name: "Moldovan Leu", symbol: "Leu", code: "MDL"},
  {name: "Mongolian Tögrög", symbol: "₮", code: "MNT"},
  {name: "Moroccan Dirham", symbol: "DH", code: "MAD"},
  {name: "Mozambican Metical", symbol: "Mt", code: "MZN"},
  {name: "Namibian Dollar", symbol: "$", code: "NAD"},
  {name: "Nepalese Rupee", symbol: "Re", code: "NPR"},
  {name: "Netherlands Antillean Guilder", symbol: "ƒ", code: "ANG"},
  {name: "New Taiwan Dollar", symbol: "$", code: "TWD"},
  {name: "New Zealand Dollar", symbol: "$", code: "NZD"},
  {name: "Nicaraguan Córdoba", symbol: "C$", code: "NIO"},
  {name: "Nigerian Naira", symbol: "₦", code: "NGN"},
  {name: "North Korean Won", symbol: "₩", code: "KPW"},
  {name: "Norwegian Krone", symbol: "kr", code: "NOK"},
  {name: "Omani Rial", symbol: "RO", code: "OMR"},
  {name: "Pakistani Rupee", symbol: "Re", code: "PKR"},
  {name: "Panamanian Balboa", symbol: "B/", code: "PAB"},
  {name: "Papua New Guinean Kina", symbol: "K", code: "PGK"},
  {name: "Paraguayan Guaraní", symbol: "₲", code: "PYG"},
  {name: "Peruvian Sol", symbol: "S/", code: "PEN"},
  {name: "Philippine Peso", symbol: "₱", code: "PHP"},
  {name: "Polish Złoty", symbol: "zł", code: "PLN"},
  {name: "Qatari Riyal", symbol: "QR", code: "QAR"},
  {name: "Renminbi", symbol: "¥", code: "CNY"},
  {name: "Romanian Leu", symbol: "Leu", code: "RON"},
  {name: "Russian Ruble", symbol: "₽", code: "RUB"},
  {name: "Rwandan Franc", symbol: "Fr", code: "RWF"},
  {name: "Saint Helena Pound", symbol: "£", code: "SHP"},
  {name: "Samoan Tālā", symbol: "$", code: "WST"},
  {name: "São Tomé And Príncipe Dobra", symbol: "Db", code: "STN"},
  {name: "Saudi Riyal", symbol: "Rl", code: "SAR"},
  {name: "Serbian Dinar", symbol: "DIN", code: "RSD"},
  {name: "Seychellois Rupee", symbol: "Re", code: "SCR"},
  {name: "Sierra Leonean Leone", symbol: "Le", code: "SLE"},
  {name: "Singapore Dollar", symbol: "$", code: "SGD"},
  {name: "Solomon Islands Dollar", symbol: "$", code: "SBD"},
  {name: "Somali Shilling", symbol: "Sh", code: "SOS"},
  {name: "South African Rand", symbol: "R", code: "ZAR"},
  {name: "South Korean Won", symbol: "₩", code: "KRW"},
  {name: "South Sudanese Pound", symbol: "(none)", code: "SSP"},
  {name: "Sri Lankan Rupee", symbol: "Re", code: "LKR"},
  {name: "Sterling", symbol: "£", code: "GBP"},
  {name: "Sudanese Pound", symbol: "LS", code: "SDG"},
  {name: "Surinamese Dollar", symbol: "$", code: "SRD"},
  {name: "Swazi Lilangeni", symbol: "L", code: "SZL"},
  {name: "Swedish Krona", symbol: "kr", code: "SEK"},
  {name: "Swiss Franc", symbol: "Fr", code: "CHF"},
  {name: "Syrian Pound", symbol: "LS", code: "SYP"},
  {name: "Tajikistani Somoni", symbol: "SM", code: "TJS"},
  {name: "Tanzanian Shilling", symbol: "Sh", code: "TZS"},
  {name: "Thai Baht", symbol: "฿", code: "THB"},
  {name: "Tongan Paʻanga", symbol: "T$", code: "TOP"},
  {name: "Trinidad And Tobago Dollar", symbol: "$", code: "TTD"},
  {name: "Tunisian Dinar", symbol: "DT", code: "TND"},
  {name: "Turkish Lira", symbol: "₺", code: "TRY"},
  {name: "Turkmenistani Manat", symbol: "m", code: "TMT"},
  {name: "Ugandan Shilling", symbol: "Sh", code: "UGX"},
  {name: "Ukrainian Hryvnia", symbol: "₴", code: "UAH"},
  {name: "United Arab Emirates Dirham", symbol: "Dh", code: "AED"},
  {name: "United States Dollar", symbol: "$", code: "USD"},
  {name: "Uruguayan Peso", symbol: "$", code: "UYU"},
  {name: "Uzbekistani Sum", symbol: "soum", code: "UZS"},
  {name: "Vanuatu Vatu", symbol: "VT", code: "VUV"},
  {name: "Venezuelan Digital Bolívar", symbol: "Bs.D", code: "VED"},
  {name: "Venezuelan Sovereign Bolívar", symbol: "Bs.S", code: "VES"},
  {name: "Vietnamese Đồng", symbol: "₫", code: "VND"},
  {name: "West African CFA Franc", symbol: "Fr", code: "XOF"},
  {name: "Yemeni Rial", symbol: "Rl", code: "YER"},
  {name: "Zambian Kwacha", symbol: "K", code: "ZMW"},
]

export const defaultCurrencyOption = currencyOptions.find(c => c.code === "SAT")

export const getCurrencyOption = (code: string): CurrencyOption =>
  currencyOptions.find(c => c.code === code) || {name: code, symbol: "$", code}

export const displayCurrency = ({code, name}: CurrencyOption) => `${code} (${name})`

export const displayCurrencyByCode = (code: string) => displayCurrency(getCurrencyOption(code))
