// Header — SBL site top bar. Attaches to window for cross-file use.
// PT | EN | ES language switch. Stored in localStorage via window.SBL_I18N.
function LangSwitch({ lang, setLang, size }) {
const opts = [
{ id: 'pt', label: 'PT' },
{ id: 'en', label: 'EN' },
{ id: 'es', label: 'ES' },
];
const pad = size === 'lg' ? '7px 12px' : '5px 9px';
const fs = size === 'lg' ? 13 : 12;
return (
{opts.map((o) => {
const on = lang === o.id;
return (
);
})}
);
}
function Header({ active, onNav, onAnnounce }) {
const { Button } = window.SBLImVeisDesignSystem_08a506;
const { isMobile, isTablet } = window.useResponsive();
const { t, lang, setLang } = window.useLang();
const [scrolled, setScrolled] = React.useState(false);
const [menuOpen, setMenuOpen] = React.useState(false);
const links = [
{ id: 'home', label: 'Início' },
{ id: 'listings', label: 'Imóveis' },
{ id: 'season', label: 'Temporada' },
{ id: 'owner', label: 'Anuncie' },
{ id: 'contact', label: 'Contato' },
];
return (
<>
{ e.preventDefault(); onNav('home'); }}
style={{ display: 'flex', alignItems: 'center', gap: 12, cursor: 'pointer' }}>
{!isMobile && (
)}
{!isMobile &&
}
{!isMobile && !isTablet && (
(83) 9958-5248
)}
{!isMobile && (
)}
{isMobile && (
)}
{/* Mobile overlay menu — rendered outside