const { useEffect, useState } = React;
function normalizePath(pathname) {
if (!pathname || pathname === "/" || pathname === "/index.html") {
return "/";
}
if (pathname.length > 1 && pathname.endsWith("/")) {
return pathname;
}
if (pathname.indexOf(".") === -1) {
return pathname + "/";
}
return pathname;
}
function App() {
const [scrolled, setScrolled] = useState(false);
useEffect(function bindScrollListener() {
const onScroll = function onScroll() {
setScrolled(window.scrollY > 20);
};
onScroll();
window.addEventListener("scroll", onScroll);
return function cleanup() {
window.removeEventListener("scroll", onScroll);
};
}, []);
const currentPath = normalizePath(window.location.pathname);
const links = [
{ label: "Inicio", href: "/" },
{ label: "Sobre Nosotros", href: "/sobre-nosotros/" },
{ label: "Especialidades", href: "/especialidades/" },
{ label: "Contacto", href: "/contacto/" },
];
const pageMap = {
"/": {
title: "Hernández & Asociados",
render: function renderHome() {
return