spb/countryatlas
Public
TypeScript 57%
Python 38.6%
JavaScript 3.6%
CSS 0.6%
1'use client';2import { usePathname } from 'next/navigation';3import type { ReactNode } from 'react';4import { cn } from '@/lib/cn';56/** Routes rendered edge to edge (full-viewport explorers): no horizontal padding, no max width. */7export const FULL_BLEED_PREFIXES = ['/explore', '/trajectories'];89export function isFullBleed(pathname: string): boolean {10 return FULL_BLEED_PREFIXES.some((p) => pathname === p || pathname.startsWith(`${p}/`) || pathname.startsWith(`${p}?`));11}1213/**14 * `<main>` wrapper: editorial container (1400 px, side padding) for content pages, full bleed for the15 * explorer views. Pathname-driven so the App Router tree needs no route-group shuffle.16 */17export function MainFrame({ children }: { children: ReactNode }) {18 const pathname = usePathname();19 const full = isFullBleed(pathname);20 return (21 <main id="main" data-layout={full ? 'full' : 'page'} className={cn('w-full flex-1', full ? 'min-w-0' : 'container-x mx-auto max-w-[1400px]')}>22 {children}23 </main>24 );25}26