import type { ReactNode } from "react"; import { AnimatePresence, motion, useReducedMotion } from "framer-motion"; import { cn } from "#/utils/utils"; const ACCORDION_TRANSITION = { duration: 0.2, ease: "easeInOut" as const, }; interface AccordionPanelProps { open: boolean; children: ReactNode; testId?: string; className?: string; } /** * Height/opacity expand-collapse wrapper for Diffs / Commits accordion rows. * Honors prefers-reduced-motion by skipping animation. */ export function AccordionPanel({ open, children, testId, className, }: AccordionPanelProps) { const reduceMotion = useReducedMotion(); if (reduceMotion) { return open ? (