// Main app: Sumafin landing page const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "showBrands": true, "showStats": true, "showTestimonials": true, "heroAccentStyle": "blue" }/*EDITMODE-END*/; const HERO_STYLES = { blue: { accent: "var(--blue)" }, navy: { accent: "var(--navy)" }, cyan: { accent: "var(--cyan)" }, }; function App() { const [t, setTweak] = useTweaks(TWEAK_DEFAULTS); useEffect(() => { const s = HERO_STYLES[t.heroAccentStyle] || HERO_STYLES.blue; document.documentElement.style.setProperty('--hero-accent', s.accent); }, [t.heroAccentStyle]); useEffect(() => { const onClick = (e) => { const a = e.target.closest('a[href^="#"]'); if (!a) return; const id = a.getAttribute("href").slice(1); if (!id) return; const el = document.getElementById(id); if (el) { e.preventDefault(); const y = el.getBoundingClientRect().top + window.scrollY - 70; window.scrollTo({ top: y, behavior: "smooth" }); } }; document.addEventListener("click", onClick); return () => document.removeEventListener("click", onClick); }, []); return ( <> {t.showStats && } {t.showTestimonials && } {t.showBrands && } setTweak("showStats", v)} /> setTweak("showTestimonials", v)} /> setTweak("showBrands", v)} /> {[ ["#cotiza", "→ Solicita cotización"], ["#productos", "→ Productos"], ["#como-funciona", "→ Cómo funciona"], ["#sucursales", "→ Sucursales"], ["#faq", "→ Preguntas frecuentes"], ].map(([href, label]) => ( {label} ))} > ); } const root = ReactDOM.createRoot(document.getElementById("root")); root.render();