import {
  countryFlagUrl,
  countryCrestUrl,
  countryLogoUrl,
  getBuiltinCountry,
  hasCountryCrest,
} from '../data/builtinCountries';

export {
  countryFlagUrl,
  countryCrestUrl,
  countryLogoUrl,
  getBuiltinCountry,
  hasCountryCrest,
};

export function suggestTeamFlagUrl(code?: string): string {
  const c = getBuiltinCountry(code);
  if (!c) return '';
  return hasCountryCrest(c) ? countryCrestUrl(c) : countryFlagUrl(c);
}
