diff --git a/frontend/src/BillingManager.jsx b/frontend/src/BillingManager.jsx index 5fdbe4f..89581d2 100644 --- a/frontend/src/BillingManager.jsx +++ b/frontend/src/BillingManager.jsx @@ -325,6 +325,30 @@ function BillingManager() { return String.fromCodePoint(...codePoints); } + // Favicon для провайдера по ссылке входа + function normalizeToUrl(value) { + if (!value) return ''; + try { + const hasProtocol = /^https?:\/\//i.test(value); + const url = new URL(hasProtocol ? value : `https://${value}`); + return url.toString(); + } catch { + return ''; + } + } + + function getFaviconUrl(loginUrl) { + const normalized = normalizeToUrl(loginUrl); + if (!normalized) return ''; + try { + const { hostname } = new URL(normalized); + // DuckDuckGo Icons API: быстрая выдача favicon по домену + return `https://icons.duckduckgo.com/ip3/${hostname}.ico`; + } catch { + return ''; + } + } + function getCountryFlag(countryRaw) { if (!countryRaw) return ''; const value = String(countryRaw).trim(); @@ -717,9 +741,19 @@ function BillingManager() {