// Gate the Content section behind the "En construction" placeholder in prod
// builds (see src/lib/feature-status). Done at the segment layout — not a proxy
// rewrite — so RSC navigations don't trigger Next's cross-origin self-fetch.
// Content is also site-scoped: en dev (où le placeholder ne s'applique pas) un
// membre sans site partagé voit l'explication plutôt que des pages vides.
import { UnderConstructionView } from "@/components/under-construction-view";
import { constructionBlockActive } from "@/lib/feature-status";
import { siteScopedGate } from "@/lib/sites/site-scoped-gate";

export default async function ContentLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  if (constructionBlockActive()) return <UnderConstructionView />;
  return (await siteScopedGate()) ?? children;
}
