import { motion, useReducedMotion } from "motion/react"; import { Children, type ReactNode } from "react"; import { cn } from "@/lib/utils"; /** * Page content wrapper that animates in on mount — so the content fans up into * place every time you navigate or load a route (the route remounts, this * remounts). Each direct child is staggered a beat after the previous (the same * on-mount-delay pattern the sidebar nav uses). Honours prefers-reduced-motion. */ export function Section({ children, className, }: { children: ReactNode; className?: string; }) { const reduce = useReducedMotion(); return (
{Children.map(children, (child, i) => reduce ? ( child ) : ( {child} ), )}
); }