// Shared tokens, helpers, top nav and floating CTA
const { useState, useEffect, useRef } = React;
const C = {
ink: '#0E3B3A',
inkDeep: '#072A29',
inkDark: '#050708',
coral: '#E89A8E',
coralDeep: '#C97B6E',
neon: '#FF8B7A',
cream: '#F4EDE3',
paper: '#FAF6F0',
bone: '#EDE4D6',
white: '#FFFFFF',
};
const WA_NUMBER = '5571992628880';
const waLink = (msg) => `https://wa.me/${WA_NUMBER}?text=${encodeURIComponent(msg)}`;
// Eyebrow
function Eyebrow({ children, light }) {
return (
{children}
);
}
// Pill
function Pill({ children, dark }) {
return (
{children}
);
}
// Primary CTA — coral pill com seta
function PrimaryCTA({ href, children, sub, target }) {
return (
{children}
{sub &&
{sub}
}
→
);
}
function GhostCTA({ href, children, target }) {
return (
{children}
);
}
function LightCTA({ href, children }) {
return (
{children}
);
}
// ===== Top Navigation =====
function TopNav() {
const [scrolled, setScrolled] = useState(false);
useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 40);
window.addEventListener('scroll', onScroll);
return () => window.removeEventListener('scroll', onScroll);
}, []);
const links = [
['Consulta', '#consulta'],
['Tratamentos', '#areas'],
['Protocolos', '#protocolos'],
['Avaliações', '#avaliacoes'],
['FAQ', '#faq'],
];
return (
);
}
// ===== Floating WhatsApp =====
function FloatingCTA() {
const [shown, setShown] = useState(false);
useEffect(() => {
const onScroll = () => setShown(window.scrollY > 800);
window.addEventListener('scroll', onScroll);
return () => window.removeEventListener('scroll', onScroll);
}, []);
return (
);
}
// Image placeholder — striped, with monospace label
function ImgPlaceholder({ label, ratio = '4/5', className = '', tone = 'dark' }) {
const isDark = tone === 'dark';
return (
);
}
Object.assign(window, { C, waLink, Eyebrow, Pill, PrimaryCTA, GhostCTA, LightCTA, TopNav, FloatingCTA, ImgPlaceholder });