/* Maitha Tech — site navigation.
New monochrome navbar in the DS language. Same menu items as the
live site: Sobre a Maitha · O que fazemos (units) · Conteúdos · Carreiras
plus the "Fale conosco" CTA. Desktop hover dropdowns + mobile sheet. */
const NAV_UNITS = [
{ label: "Digital Unit", desc: "Criação e evolução de soluções digitais", href: "digital-unit.html" },
{ label: "Data Unit", desc: "Geração de valor com dados", href: "data-unit.html" },
{ label: "AI Unit", desc: "Inteligência Artificial com foco em impacto", href: "ai-unit.html" },
{ label: "Cloud Unit", desc: "Implementação e otimização de nuvem", href: "cloud-unit.html" },
{ label: "Salesforce Unit", desc: "Implementação profissional de Salesforce", href: "salesforce-unit.html" },
];
const NAV_CONTEUDOS = [
{ label: "Materiais", desc: "Conteúdos mais profundos para baixar", href: "Materiais.html" },
{ label: "Blog", desc: "Artigos sobre temas relevantes", href: "https://conteudo.maitha.com.br/", external: true },
{ label: "Podcast", desc: "Conheça o Papo Tech", href: "papo-tech.html" },
{ label: "TechCircle", desc: "Nossa comunidade de líderes Tech", href: "techcircle.html" },
];
function Caret({ open }) {
return (
);
}
function DropItem({ item, onClick }) {
const [h, setH] = React.useState(false);
return (
setH(true)} onMouseLeave={() => setH(false)}
style={{ display: "grid", gridTemplateColumns: "1fr auto", gap: 16, alignItems: "center", padding: "14px 16px", borderRadius: "var(--radius-md)", background: h ? "var(--mt-near-black)" : "transparent", transition: "background var(--dur-base) var(--ease-out)" }}>
{item.label}
{item.desc}
);
}
function NavDropdown({ label, items, open, onOpen, onClose, width = 380 }) {
return (
);
}
function Nav({ active = null }) {
const [openMenu, setOpenMenu] = React.useState(null); // 'units' | 'conteudos' | null
const [mobile, setMobile] = React.useState(false);
const [acc, setAcc] = React.useState(null);
const [scrolled, setScrolled] = React.useState(false);
React.useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 12);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
React.useEffect(() => {
document.body.style.overflow = mobile ? "hidden" : "";
return () => { document.body.style.overflow = ""; };
}, [mobile]);
return (
{/* —— Mobile sheet (rendered OUTSIDE
);
}
function MobileLink({ label, href, onNav }) {
return (
{label}
);
}
function MobileAccordion({ label, items, open, onToggle, onNav }) {
return (
);
}
window.Nav = Nav;