import type { ReactNode } from 'react' import { AnimatePresence, motion } from 'motion/react' type CollapseProps = { open: boolean; children: ReactNode } // Height auto-animation — the same spring as the meta-ficus FAQ accordion // (height 0 ↔ auto, opacity, overflow-hidden). The body is mounted only while // open (AnimatePresence), so heavy children (highlighted code) neither render // nor tokenize until expanded — and unmount again on collapse. export function Collapse({ open, children }: CollapseProps) { return ( {open && ( {children} )} ) }