type IRatio = '1x1' | '4x3'; type ICountryCode = | 'af' | 'ax' | 'al' | 'dz' | 'as' | 'ad' | 'ao' | 'ai' | 'aq' | 'ag' | 'ar' | 'am' | 'aw' | 'sh-ac' | 'asean' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bd' | 'bb' | 'es-pv' | 'by' | 'be' | 'bz' | 'bj' | 'bm' | 'bt' | 'bo' | 'bq' | 'ba' | 'bw' | 'bv' | 'br' | 'io' | 'bn' | 'bg' | 'bf' | 'bi' | 'cv' | 'kh' | 'cm' | 'ca' | 'ic' | 'es-ct' | 'ky' | 'cf' | 'cefta' | 'td' | 'cl' | 'cn' | 'cx' | 'cp' | 'cc' | 'co' | 'km' | 'ck' | 'cr' | 'hr' | 'cu' | 'cw' | 'cy' | 'cz' | 'ci' | 'cd' | 'dk' | 'dg' | 'dj' | 'dm' | 'do' | 'eac' | 'ec' | 'eg' | 'sv' | 'gb-eng' | 'gq' | 'er' | 'ee' | 'sz' | 'et' | 'eu' | 'fk' | 'fo' | 'fm' | 'fj' | 'fi' | 'fr' | 'gf' | 'pf' | 'tf' | 'ga' | 'es-ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gi' | 'gr' | 'gl' | 'gd' | 'gp' | 'gu' | 'gt' | 'gg' | 'gn' | 'gw' | 'gy' | 'ht' | 'hm' | 'va' | 'hn' | 'hk' | 'hu' | 'is' | 'in' | 'id' | 'ir' | 'iq' | 'ie' | 'im' | 'il' | 'it' | 'jm' | 'jp' | 'je' | 'jo' | 'kz' | 'ke' | 'ki' | 'xk' | 'kw' | 'kg' | 'la' | 'lv' | 'arab' | 'lb' | 'ls' | 'lr' | 'ly' | 'li' | 'lt' | 'lu' | 'mo' | 'mg' | 'mw' | 'my' | 'mv' | 'ml' | 'mt' | 'mh' | 'mq' | 'mr' | 'mu' | 'yt' | 'mx' | 'md' | 'mc' | 'mn' | 'me' | 'ms' | 'ma' | 'mz' | 'mm' | 'na' | 'nr' | 'np' | 'nl' | 'nc' | 'nz' | 'ni' | 'ne' | 'ng' | 'nu' | 'nf' | 'kp' | 'mk' | 'gb-nir' | 'mp' | 'no' | 'om' | 'pc' | 'pk' | 'pw' | 'pa' | 'pg' | 'py' | 'pe' | 'ph' | 'pn' | 'pl' | 'pt' | 'pr' | 'qa' | 'cg' | 'ro' | 'ru' | 'rw' | 're' | 'bl' | 'sh-hl' | 'sh' | 'kn' | 'lc' | 'mf' | 'pm' | 'vc' | 'ws' | 'sm' | 'st' | 'sa' | 'gb-sct' | 'sn' | 'rs' | 'sc' | 'sl' | 'sg' | 'sx' | 'sk' | 'si' | 'sb' | 'so' | 'za' | 'gs' | 'kr' | 'ss' | 'es' | 'lk' | 'ps' | 'sd' | 'sr' | 'sj' | 'se' | 'ch' | 'sy' | 'tw' | 'tj' | 'tz' | 'th' | 'tl' | 'tg' | 'tk' | 'to' | 'tt' | 'sh-ta' | 'tn' | 'tm' | 'tc' | 'tv' | 'tr' | 'ug' | 'ua' | 'ae' | 'gb' | 'un' | 'um' | 'us' | 'xx' | 'uy' | 'uz' | 'vu' | 've' | 'vn' | 'vg' | 'vi' | 'gb-wls' | 'wf' | 'eh' | 'ye' | 'zm' | 'zw'; type ICountryName = | 'Afghanistan' | 'Aland Islands' | 'Albania' | 'Algeria' | 'American Samoa' | 'Andorra' | 'Angola' | 'Anguilla' | 'Antarctica' | 'Antigua and Barbuda' | 'Argentina' | 'Armenia' | 'Aruba' | 'Ascension Island' | 'Association of Southeast Asian Nations' | 'Australia' | 'Austria' | 'Azerbaijan' | 'Bahamas' | 'Bahrain' | 'Bangladesh' | 'Barbados' | 'Basque Country' | 'Belarus' | 'Belgium' | 'Belize' | 'Benin' | 'Bermuda' | 'Bhutan' | 'Bolivia' | 'Bonaire, Sint Eustatius and Saba' | 'Bosnia and Herzegovina' | 'Botswana' | 'Bouvet Island' | 'Brazil' | 'British Indian Ocean Territory' | 'Brunei Darussalam' | 'Bulgaria' | 'Burkina Faso' | 'Burundi' | 'Cabo Verde' | 'Cambodia' | 'Cameroon' | 'Canada' | 'Canary Islands' | 'Catalonia' | 'Cayman Islands' | 'Central African Republic' | 'Central European Free Trade Agreement' | 'Chad' | 'Chile' | 'China' | 'Christmas Island' | 'Clipperton Island' | 'Cocos (Keeling) Islands' | 'Colombia' | 'Comoros' | 'Cook Islands' | 'Costa Rica' | 'Croatia' | 'Cuba' | 'Curaçao' | 'Cyprus' | 'Czech Republic' | "Côte d'Ivoire" | 'Democratic Republic of the Congo' | 'Denmark' | 'Diego Garcia' | 'Djibouti' | 'Dominica' | 'Dominican Republic' | 'East African Community' | 'Ecuador' | 'Egypt' | 'El Salvador' | 'England' | 'Equatorial Guinea' | 'Eritrea' | 'Estonia' | 'Eswatini' | 'Ethiopia' | 'Europe' | 'Falkland Islands' | 'Faroe Islands' | 'Federated States of Micronesia' | 'Fiji' | 'Finland' | 'France' | 'French Guiana' | 'French Polynesia' | 'French Southern Territories' | 'Gabon' | 'Galicia' | 'Gambia' | 'Georgia' | 'Germany' | 'Ghana' | 'Gibraltar' | 'Greece' | 'Greenland' | 'Grenada' | 'Guadeloupe' | 'Guam' | 'Guatemala' | 'Guernsey' | 'Guinea' | 'Guinea-Bissau' | 'Guyana' | 'Haiti' | 'Heard Island and McDonald Islands' | 'Holy See' | 'Honduras' | 'Hong Kong' | 'Hungary' | 'Iceland' | 'India' | 'Indonesia' | 'Iran' | 'Iraq' | 'Ireland' | 'Isle of Man' | 'Israel' | 'Italy' | 'Jamaica' | 'Japan' | 'Jersey' | 'Jordan' | 'Kazakhstan' | 'Kenya' | 'Kiribati' | 'Kosovo' | 'Kuwait' | 'Kyrgyzstan' | 'Laos' | 'Latvia' | 'League of Arab States' | 'Lebanon' | 'Lesotho' | 'Liberia' | 'Libya' | 'Liechtenstein' | 'Lithuania' | 'Luxembourg' | 'Macau' | 'Madagascar' | 'Malawi' | 'Malaysia' | 'Maldives' | 'Mali' | 'Malta' | 'Marshall Islands' | 'Martinique' | 'Mauritania' | 'Mauritius' | 'Mayotte' | 'Mexico' | 'Moldova' | 'Monaco' | 'Mongolia' | 'Montenegro' | 'Montserrat' | 'Morocco' | 'Mozambique' | 'Myanmar' | 'Namibia' | 'Nauru' | 'Nepal' | 'Netherlands' | 'New Caledonia' | 'New Zealand' | 'Nicaragua' | 'Niger' | 'Nigeria' | 'Niue' | 'Norfolk Island' | 'North Korea' | 'North Macedonia' | 'Northern Ireland' | 'Northern Mariana Islands' | 'Norway' | 'Oman' | 'Pacific Community' | 'Pakistan' | 'Palau' | 'Panama' | 'Papua New Guinea' | 'Paraguay' | 'Peru' | 'Philippines' | 'Pitcairn' | 'Poland' | 'Portugal' | 'Puerto Rico' | 'Qatar' | 'Republic of the Congo' | 'Romania' | 'Russia' | 'Rwanda' | 'Réunion' | 'Saint Barthélemy' | 'Saint Helena' | 'Saint Helena, Ascension and Tristan da Cunha' | 'Saint Kitts and Nevis' | 'Saint Lucia' | 'Saint Martin' | 'Saint Pierre and Miquelon' | 'Saint Vincent and the Grenadines' | 'Samoa' | 'San Marino' | 'Sao Tome and Principe' | 'Saudi Arabia' | 'Scotland' | 'Senegal' | 'Serbia' | 'Seychelles' | 'Sierra Leone' | 'Singapore' | 'Sint Maarten' | 'Slovakia' | 'Slovenia' | 'Solomon Islands' | 'Somalia' | 'South Africa' | 'South Georgia and the South Sandwich Islands' | 'South Korea' | 'South Sudan' | 'Spain' | 'Sri Lanka' | 'State of Palestine' | 'Sudan' | 'Suriname' | 'Svalbard and Jan Mayen' | 'Sweden' | 'Switzerland' | 'Syria' | 'Taiwan' | 'Tajikistan' | 'Tanzania' | 'Thailand' | 'Timor-Leste' | 'Togo' | 'Tokelau' | 'Tonga' | 'Trinidad and Tobago' | 'Tristan da Cunha' | 'Tunisia' | 'Turkmenistan' | 'Turks and Caicos Islands' | 'Tuvalu' | 'Türkiye' | 'Uganda' | 'Ukraine' | 'United Arab Emirates' | 'United Kingdom' | 'United Nations' | 'United States Minor Outlying Islands' | 'United States of America' | 'Unknown' | 'Uruguay' | 'Uzbekistan' | 'Vanuatu' | 'Venezuela' | 'Vietnam' | 'Virgin Islands (British)' | 'Virgin Islands (U.S.)' | 'Wales' | 'Wallis and Futuna' | 'Western Sahara' | 'Yemen' | 'Zambia' | 'Zimbabwe'; type ICountryCapital = | 'Kabul' | 'Mariehamn' | 'Tirana' | 'Algiers' | 'Pago Pago' | 'Andorra la Vella' | 'Luanda' | 'The Valley' | "St. John's" | 'Buenos Aires' | 'Yerevan' | 'Oranjestad' | 'Georgetown' | 'Canberra' | 'Vienna' | 'Baku' | 'Nassau' | 'Manama' | 'Dhaka' | 'Bridgetown' | 'Minsk' | 'Brussels' | 'Belmopan' | 'Porto-Novo' | 'Hamilton' | 'Thimphu' | 'Sucre' | 'Kralendijk' | 'Sarajevo' | 'Gaborone' | 'Brasília' | 'Diego Garcia' | 'Bandar Seri Begawan' | 'Sofia' | 'Ouagadougou' | 'Bujumbura' | 'Praia' | 'Phnom Penh' | 'Yaoundé' | 'Ottawa' | 'George Town' | 'Bangui' | "N'Djamena" | 'Santiago' | 'Beijing' | 'Flying Fish Cove' | 'West Island' | 'Bogotá' | 'Moroni' | 'Avarua' | 'San José' | 'Zagreb' | 'Havana' | 'Willemstad' | 'Nicosia' | 'Prague' | 'Yamoussoukro' | 'Kinshasa' | 'Copenhagen' | 'Djibouti' | 'Roseau' | 'Santo Domingo' | 'Quito' | 'Cairo' | 'San Salvador' | 'London' | 'Malabo' | 'Asmara' | 'Tallinn' | 'Lobamba, Mbabane' | 'Addis Ababa' | 'Stanley' | 'Tórshavn' | 'Palikir' | 'Suva' | 'Helsinki' | 'Paris' | 'Cayenne' | 'Papeete' | 'Saint-Pierre, Réunion' | 'Libreville' | 'Banjul' | 'Tbilisi' | 'Berlin' | 'Accra' | 'Gibraltar' | 'Athens' | 'Nuuk' | "St. George's" | 'Basse-Terre' | 'Hagåtña' | 'Guatemala City' | 'Saint Peter Port' | 'Conakry' | 'Bissau' | 'Georgetown' | 'Port-au-Prince' | 'Vatican City' | 'Tegucigalpa' | 'Hong Kong' | 'Budapest' | 'Reykjavik' | 'New Delhi' | 'Jakarta' | 'Tehran' | 'Baghdad' | 'Dublin' | 'Douglas' | 'Jerusalem' | 'Rome' | 'Kingston' | 'Tokyo' | 'Saint Helier' | 'Amman' | 'Astana' | 'Nairobi' | 'South Tarawa' | 'Pristina' | 'Kuwait City' | 'Bishkek' | 'Vientiane' | 'Riga' | 'Beirut' | 'Maseru' | 'Monrovia' | 'Tripoli' | 'Vaduz' | 'Vilnius' | 'Luxembourg City' | 'Macau' | 'Antananarivo' | 'Lilongwe' | 'Kuala Lumpur' | 'Malé' | 'Bamako' | 'Valletta' | 'Majuro' | 'Fort-de-France' | 'Nouakchott' | 'Port Louis' | 'Mamoudzou' | 'Mexico City' | 'Chișinău' | 'Monaco' | 'Ulaanbaatar' | 'Podgorica' | 'Little Bay, Brades, Plymouth' | 'Rabat' | 'Maputo' | 'Naypyidaw' | 'Windhoek' | 'Yaren District' | 'Kathmandu' | 'Amsterdam' | 'Nouméa' | 'Wellington' | 'Managua' | 'Niamey' | 'Abuja' | 'Alofi' | 'Kingston' | 'Pyongyang' | 'Skopje' | 'Belfast' | 'Saipan' | 'Oslo' | 'Muscat' | 'Islamabad' | 'Ngerulmud' | 'Panama City' | 'Port Moresby' | 'Asunción' | 'Lima' | 'Manila' | 'Adamstown' | 'Warsaw' | 'Lisbon' | 'San Juan' | 'Doha' | 'Brazzaville' | 'Bucharest' | 'Moscow' | 'Kigali' | 'Saint-Denis' | 'Gustavia' | 'Jamestown' | 'Jamestown' | 'Basseterre' | 'Castries' | 'Marigot' | 'Saint-Pierre' | 'Kingstown' | 'Apia' | 'San Marino' | 'São Tomé' | 'Riyadh' | 'Edinburgh' | 'Dakar' | 'Belgrade' | 'Victoria' | 'Freetown' | 'Singapore' | 'Philipsburg' | 'Bratislava' | 'Ljubljana' | 'Honiara' | 'Mogadishu' | 'Pretoria' | 'King Edward Point' | 'Seoul' | 'Juba' | 'Madrid' | 'Sri Jayawardenepura Kotte, Colombo' | 'Ramallah' | 'Khartoum' | 'Paramaribo' | 'Longyearbyen' | 'Stockholm' | 'Bern' | 'Damascus' | 'Taipei' | 'Dushanbe' | 'Dodoma' | 'Bangkok' | 'Dili' | 'Lomé' | 'Nukunonu, Atafu,Tokelau' | 'Nukuʻalofa' | 'Port of Spain' | 'Edinburgh of the Seven Seas' | 'Tunis' | 'Ashgabat' | 'Cockburn Town' | 'Funafuti' | 'Ankara' | 'Kampala' | 'Kiev' | 'Abu Dhabi' | 'London' | 'Washington, D.C.' | 'Washington, D.C.' | 'Montevideo' | 'Tashkent' | 'Port Vila' | 'Caracas' | 'Hanoi' | 'Road Town' | 'Charlotte Amalie' | 'Cardiff' | 'Mata-Utu' | 'Laayoune' | "Sana'a" | 'Lusaka' | 'Harare'; type IOptions = { name?: ICountryName; code?: ICountryCode; capital?: ICountryCapital; ratio?: IRatio; }; import countryList from '../../assets/flag-icons/country.json'; const makeClassNameList = (entryOptions: Partial) => { const output: string[] = []; const options: IOptions = { ratio: '4x3', ...entryOptions, }; output.push('fi'); if (options.ratio == '1x1') { output.push('fis'); } if (options.code) { output.push(`fi-${options.code}`); } else if (options.capital || options.name) { const capital = options.capital || ''; const name = options.name || ''; const findedItems = countryList.filter((item) => { return item.name == name || item.capital == capital; }); findedItems[0] && output.push(`fi-${findedItems[0].code}`); } return output; }; export default { makeClassNameList };