"use client";

import { usePathname } from "next/navigation";
import type { ReactNode } from "react";
import Footer from "./Footer";
import Header from "./Header";

/* The signed-in Hub (/hub and below, not /hub-login) has its own header and footer (src/app/hub/layout.tsx). */
export const isHubPath = (pathname: string) => pathname === "/hub" || pathname.startsWith("/hub/");

export default function SiteFrame({ children }: { children: ReactNode }) {
  if (isHubPath(usePathname())) return children;
  return (
    <>
      <a className="mz-skip" href="#main">Skip to content</a>
      <Header />
      <main id="main">{children}</main>
      <Footer />
    </>
  );
}
