const { Brand, LangSwitcher, Icon } = window.CoolZoneSolutionDesignSystem_12e696; // Anchors like #uslugi only resolve on the homepage — from any other page // (project-check.html, configurator.html, ...) they need to link back to // index.html first, otherwise clicking them silently does nothing. const path = window.location.pathname; const ON_HOME = path === '/' || path.endsWith('/index.html') || path.endsWith('/'); const HOME_HREF = ON_HOME ? '' : 'index.html'; function SiteHeader({ t, lang, setLang, scrolled }) { const anchors = ['uslugi', 'dla-kogo', 'proces', 'realizacje', 'opinie', 'faq']; const ids = [...anchors.map((a) => `${HOME_HREF}#${a}`), 'project-check.html']; const ctaHref = `${HOME_HREF}#kontakt`; const [open, setOpen] = React.useState(false); const close = () => setOpen(false); React.useEffect(() => { close(); }, [lang]); React.useEffect(() => { fetch('/api/config-api.php/public') .then((r) => (r.ok ? r.json() : null)) .then((cfg) => { if (!cfg || !cfg.favicon_path) return; let link = document.querySelector('link[rel="icon"]'); if (!link) { link = document.createElement('link'); link.rel = 'icon'; document.head.appendChild(link); } link.type = cfg.favicon_path.endsWith('.svg') ? 'image/svg+xml' : 'image/png'; link.href = cfg.favicon_path; }) .catch(() => {}); }, []); return (
{t.nav[6]}
); } Object.assign(window, { SiteHeader });