robosats/frontend/src/components/getFlags.js

14 lines
516 B
JavaScript
Raw Normal View History

import React, { Component } from 'react';
import Flag from 'react-flagkit';
import SwapCallsIcon from '@mui/icons-material/SwapCalls';
2022-01-15 15:12:26 +00:00
export default function getFlags(code){
2022-02-19 18:44:02 +00:00
if(code == 'BTC') return <SwapCallsIcon color="primary"/>;
if(code == 'XAU') return '🟨';
if(code == 'AZN') return '🇦🇿'; // code AZ not working
if(code == 'XOF') code = 'SN';
if(code == 'ANG') code = 'CW';
return <div style={{width:24, height: 18}}><Flag country={code.substring(0,2)} size={18}/></div>;
};