extract components from website
This commit is contained in:
8
apps/website/lib/utilities/country.ts
Normal file
8
apps/website/lib/utilities/country.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export function getCountryFlag(countryCode: string): string {
|
||||
const code = countryCode.toUpperCase();
|
||||
if (code.length === 2) {
|
||||
const codePoints = [...code].map(char => 127397 + char.charCodeAt(0));
|
||||
return String.fromCodePoint(...codePoints);
|
||||
}
|
||||
return '🏁';
|
||||
}
|
||||
Reference in New Issue
Block a user